top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to kill an activity in Android?

0 votes
1,829 views
Afinish()
BfinishActivity(int requestCode)
CBoth finish() and finishActivity(int requestCode)
Dkill()

Correct Option: 3  

Explanation:
finish() − It is used to close the activity.
finishActivity(int requestCode) − It is used to close the activity with requestCode.
posted Nov 27, 2017 by anonymous

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
+1 vote

I use this code to save the contents of a textbox to an array, i want display this array in a list view on another activity.
any idea about this? thanks.

txt = (TextView)findViewById(R.id.name);
show = (ListView)findViewById(R.id.mygardenlist);
add = (Button)findViewById(R.id.btnAdd);
add.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
    String getInput = txt.getText().toString();
    if(addArray.contains(getInput)) {
        Toast.makeText((getBaseContext()), "Plant Already Added", Toast.LENGTH_LONG).show();
    }
    else {
        addArray.add(getInput);
        ArrayAdapter<String> adapter = new ArrayAdapter<String>(SingleItemView.this, android.R.layout.simple_list_item_1, addArray);
        show.setAdapter(adapter);
        ((TextView)findViewById(R.id.name)).setText(" ");
    }
}
});
...