top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

How to kill an activity in Android?

0 votes
65 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(" ");
    }
}
});
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...