Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6248221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:01:03+00:00 2026-05-24T13:01:03+00:00

What I want is that when Activity starts first time, it first checks if

  • 0

What I want is that when Activity starts first time, it first checks if nimiolemas is true. Since it just starts, then it can’t be true. So, it will automatically starts new activity and also asks to get me info. In activity 2 person can type their name and when they press Ok, info will be sent back to activity one. Now, I don’t know really how to change there Boolean to true and send that as well, so for now I told to change nimiolemas true before launching activity 2.

After pressing ok, it sends back to activity one and does the check again. Since it should be now true and also able to retrieve information about persons name, then it will go to true condition and print that name on screen in first activity. Now whenever program is launched, it will skip asking name and will straight show the person name :).

But it doesn’t work exactly as I want. Before i put boolean, it actually went to second activity, but I couldn’t get data so well. I have been working on solution for too long and I really appreciate help. If I find mistakes I can study from that more then searching on solution all over internet for next 10 hours :(.

I might have made some things very wrong, so please let me know and teach me! I really want to get better in this! So far I have done:


package viimane.voimalus;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;

public class MainStuff extends Activity {

    String tyybinimi;
    TextView tere;

    Boolean nimiolemas;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.menu);
        tere = (TextView) findViewById(R.id.TERE);
        Intent i = new Intent(this, nimekysija.class);
        tyybinimi = i.getStringExtra("nimi");

        if (nimiolemas = true) {
            System.out.print(tyybinimi);
        } else {
            startActivity(i);
            nimiolemas = true;
            finish();
        }

    }
}

package viimane.voimalus;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
package viimane.voimalus;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class nimekysija extends Activity {

    Intent resultIntent;
    EditText nimi;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.nimekysija);
        Button kysOk = (Button) findViewById(R.id.bNimekysija);
        nimi = (EditText) findViewById(R.id.etNimekysija);

        kysOk.setOnClickListener(new View.OnClickListener() {
        String nimiS = nimi.getText().toString();


            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub
                Intent i = new Intent();
                i.putExtra("nimi", nimiS);
                startActivity(new Intent("viimane.voimalus.MAIN"));
                finish();


            }
        });
    }

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T13:01:04+00:00Added an answer on May 24, 2026 at 1:01 pm

    Instead of using a boolean, you should be using Shared Preferences.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to know that what will happen to my activity incase of an
i have a default activity that starts first (Activity A), and from there the
I have an Activity that starts and binds to a Service . I then
I have an activity (first) that starts a new activity (second). If I returned
I have just started android. I just want to know that how can i
For example, I want to write an activity that launches when you return from
I want that everytime someone wants to checkout the project from SVN he/she will
I want that the form will not close by doing Alt + F4 but
I just want that horizontal div (about 50 pixels tall) that span across the
i want to create a widget app that when added will start ConfigurationActivity which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.