Questions tagged [recreate]

recreate() is an Android SDK API method available from API lvl 11 (Android 3.0) that causes the calling Activity to be destroyed and recreated.

Official method documentation:

Cause this Activity to be recreated with a new instance. This results in essentially the same flow as when the Activity is created due to a configuration change -- the current instance will go through its lifecycle to onDestroy() and a new instance then created after it.

For more information about Android Activity lifecycle see http://developer.android.com/reference/android/app/Activity.html

122 questions
42
votes
9 answers

Prevent Fragment recovery in Android

We are using Fragments and we don't need them to be automatically recovered when the Activity is recreated. But Android every time when Activity::onCreate(Bundle savedInstanceState) -> super.onCreate(savedInstanceState) is called, restores Fragments…
goRGon
  • 4,402
  • 2
  • 43
  • 45
26
votes
6 answers

How to get query that would recreate sql table in PHPMyAdmin

I have table on MySQL server and would like to get the SQL that would re-create the table. How do I get the query to recreate the SQL table?
Borut Flis
  • 15,715
  • 30
  • 92
  • 119
26
votes
4 answers

Android make transition on activity recreate()

I would like to put a transition on activity recreate() after changing theme, is it possible? I tried: @android:anim/fade_in @android:anim/fade_out but it didn't work, and that will also affect the transition when I open and close activity, but I…
4face
  • 590
  • 1
  • 8
  • 18
21
votes
3 answers

Unable to recreate missing debug keystore?

I'm a newbie to programming in Android, and I just tried to run my build and got this message Execution failed for task ':app:validateDebugSigning'. > Unable to recreate missing debug keystore. What does this mean? I'm using Android Studio.
Brandroid
  • 266
  • 1
  • 2
  • 10
12
votes
1 answer

recreate versions - carrierwave-fog-aws

I'm trying to recreate the images that I have uploaded using the following in my model... Post.all.each do |ym| ym.avatar.cache_stored_file! ym.avatar.retrieve_from_cache!(ym.avatar.cache_name) ym.avatar.recreate_versions! …
user749798
  • 5,210
  • 10
  • 51
  • 85
9
votes
1 answer

Refresh(recreate) the activities in back stack when change locale at run time

I have an Activity say ActivityMain from this activity I moved to another activity called ActivitySettings and in settings activity I'm changing the App locale by clicking on a button, and using recreate I achieved the change I need in current…
Praneeth
  • 1,260
  • 18
  • 37
8
votes
1 answer

Use overridePendingTransition in conjuction with recreate(). Can it be done?

I've been using Android's overridePendingTransition method to animate my activity page transitions with great success. Example shown startActivity(new Intent(GetTagActivity.this, MainActivity.class)); overridePendingTransition(R.anim.fade_in,…
seekingStillness
  • 4,833
  • 5
  • 38
  • 68
8
votes
2 answers

Recreate an activity and also pass arguments

I have an activity that listens to preference changes and reloads the app. I am using recreate() to do that. But I don't know how to pass in arguments through that, so I have resorted to manual activity reloading. Intent intent =…
fuadj
  • 434
  • 4
  • 10
7
votes
2 answers

TextInputLayout hint doesn't get refreshed upon recreate() method call

I'm using TextInputLayout. I set it's hint from string.xml to apply localization. So after changing the language from the drop down I use recreate() method which refreshes the whole activity components with selected language resources but…
Feroz Khan
  • 2,396
  • 5
  • 20
  • 37
7
votes
1 answer

Re-create database when using Content Providers

My Android App has a SQLite Database and a Content Provider. This Content Provider is registered in the app's AndroidManifest.xml. It is not exported, so only my app can see it. As part of resetting the user's profile, I want to completely wipe this…
Programmer001
  • 2,240
  • 2
  • 19
  • 35
7
votes
3 answers

How to recreate previous activity?

I have a main activity (let's call it A) and a second activity (let's call it B) which's used to change the language of the app. The point is, when I click the button to change the language I also call recreate(); and B changes it language. Until…
Drumnbass
  • 867
  • 1
  • 14
  • 35
5
votes
2 answers

how to check if android going to recreate activity or destroy?

I have an android studio project. When I am rotating screen, android destroys and recreates main activity. How can I check during the destruction, if android going to recreate activity?
Vahag Chakhoyan
  • 873
  • 1
  • 10
  • 21
5
votes
3 answers

onBackPressed not calls after recreate()

Problem description: My App has Main activity and Setting Activity. After each closing Settings Activity, Main Activity recreates. Main Activity can be closed (App exit) by finish() in two places: Home button in Action Bar and Back Button (hardware…
Slava
  • 339
  • 2
  • 15
5
votes
1 answer

Getting an error on recreate() inside onOptionsItemSelected() in API 23 / Marshmallow

I am trying to make my App, which works perfectly on API<23 devices, to work on an API 23 device. It crash in the following senario. The user changes settings via options menu. If they tap slowly on the menu option (so there is time to see the…
Vega
  • 27,856
  • 27
  • 95
  • 103
5
votes
3 answers

recreate /restart activity from another activity

I have seen this Question but didn't get good answers and my situation is a little bit different. I have 2 activities A and B. From Activity A I launch Activity B but activity A must stay opened, now after I login in Activity B I save some data in…
Salam El-Banna
  • 3,784
  • 1
  • 22
  • 34
1
2 3
8 9