Top "Android-activity" questions

Questions about creating or managing Activities in Android.

How to pass a variable from Activity to Fragment, and pass it back?

I am currently making an android app, and I want to pass a date between activity and fragment. My activity …

android android-fragments android-activity
java.lang.IllegalStateException: Fragment not attached to Activity

I am rarely getting this error while making an API call. java.lang.IllegalStateException: Fragment not attached to Activity I …

android android-fragments android-activity android-volley android-lifecycle
Where/How to getIntent().getExtras() in an Android Fragment?

With Activities, I used to do this: In Activity 1: Intent i = new Intent(getApplicationContext(), MyFragmentActivity.class); i.putExtra("name", items.…

android android-intent android-fragments android-activity
Sending arrays with Intent.putExtra

I have an array of integers in the activity A: int array[] = {1,2,3}; And I want to send that variable to …

java android android-intent android-activity bundle
Finish an activity from another activity

I want to finish one activity from another activity, like: In Activity [A], on button click, I am calling Activity […

android android-intent android-activity
How do I kill an Activity when the Back button is pressed?

I got an Activity that when it starts, it loads an image from the internet. In an effort to save …

android button android-activity kill back
How to provide animation when calling another activity in Android?

I have two Activities A and B. I want to have the shrink Animation when Activity A calls B and …

android animation android-activity
How do I start an activity from within a Fragment?

I have a set of tabs inside of a FragmentActivity that each hold their own fragment. When I tried to …

android android-activity fragment
How to switch activity without animation in Android?

How can I use properly the Intent flag FLAG_ACTIVITY_NO_ANIMATION in AndroidManifest file? I supose my problem is …

android animation android-activity android-intent
Finish all activities at a time

I have an application with multiple pages i.e., multiple activities and some of them remain open. Is there a …

android android-activity activity-finish