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
4
votes
2 answers

Why isn't "--force-recreate" rebuilding my docker mysql image?

I had created a docker MySql 5.7 image, and then wanted to change a couple of names. My docker-compose.yml file ended up like so version: '3.3' services: db: image: mysql:5.7 restart: always environment: MYSQL_DATABASE:…
Dave
  • 15,639
  • 133
  • 442
  • 830
4
votes
0 answers

Fragment's method onResume stops being called when Activity's method recreate() is called

When i call recreate() for activity, my fragments do not call method onResume(), but they stil call onCreate() and onCreateView(). If I block my device and then unblock it, onResume() fires. Please explain to me why fragment's method onResume()…
Daniil Andashev
  • 154
  • 1
  • 9
4
votes
0 answers

recreate view of fragment via button

I've got a FragmentActivity which show the correct fragment, using a ViewPager. I added a Fragment StatePagerAdapter to the ViewPager. If I push a button at a Fragment, it should be recreated (onCreateView should be called again). The fragments are…
lis
  • 670
  • 1
  • 13
  • 32
4
votes
0 answers

Android how to recreate fragment view

I have an Android fragment. When I'm creating view I fill fields from layout with values from an model. and at one point I want to recreate view using the same class model but with other values. public View onCreateView(LayoutInflater inflater,…
Mosu
  • 61
  • 8
3
votes
1 answer

java.lang.RuntimeException: Cannot create an instance of class ViewModel, when android recreates Activity and Fragment

Case is of Activity-Fragment Recreate : I am creating ViewModel from activity context at activity level and trying to access the initialised ViewModel at Fragment level, using ViewModelProvider.of(). Below code works in happy case; but when activity…
3
votes
1 answer

Can recreate() be given a transition animation?

I am creating a simple examination result storage program. The activity changes theme depending on the user's current result - for example blood red for a failing grade e.t.c. When a user deletes a subject and it causes a significant change in the…
3
votes
1 answer

How to avoid fragment recreation when tap back button using navigation architecture actions?

I am using android studio navigation component to create some fragments and switch between them using the actions. Problem is that each time I tap Back button to go back from a Fragment2 to Fragment1, Fragment one is recreated. I want to avoid…
3
votes
2 answers

Trying to recreate indexOf method in JavaScript

I'm trying to recreate the indexOf array method in JavaScript. For the life of me, I can't figure out why the following isn't working: function indexOf(array, value) { for (let i = 0; i < array.length; i++) { if (array[i] === value) { …
alyslov
  • 95
  • 7
3
votes
1 answer

How to recreate the keystore file if it got deleted accidentally

I have an app which is signed and several keystore files. I'd like to update the app, so I need to find out which one of keys was used. How to recreate the keystore file if it got deleted accidentally. I have recovered it but I want to generate…
user7693621
3
votes
2 answers

Does a recreated activity remember the original intent started it?

While checking the documentation about using onSaveInstanceState, a question popped up. Let's say I'm using an app with several activities and now I'm in a specific activity that got started by a previous one. The current activity accepts extra…
Jacob.B
  • 771
  • 1
  • 9
  • 19
3
votes
2 answers

Include Intent extra when using recreate()

I'm trying to recreate() and activity on Android. I need additional data to be passed via an Intent to the recreated activity. How can this be done? The following code does not work. getIntent().putExtra("flag",true); recreate();
blaffie
  • 505
  • 1
  • 10
  • 32
3
votes
1 answer

How do I import existing iPhone app without .xcodeproj file into Xcode

I have an existing iPhone app (made on a previous version of XCode by a colleague) that I would like to import into XCode. I have the files FirstViewController.h, .m, and .xib files as well as the ones for the other views that were all renamed. I…
Robs
  • 121
  • 1
  • 3
  • 14
2
votes
1 answer

Recreate the Google+ navigation with jquery

I am currently trying to recreate the google+ navigation to the left, where you can switch your streams. I have got everything working except the functionality to show the menu opened at page reload , if the page that is being reloaded is part of…
Rob
  • 23
  • 2
2
votes
1 answer

PostgreSQL: Drop column and recreate dependent views

I have below test table and dependent views created. create table test_col_drp (col1 varchar(100), col2 varchar(100), col3 varchar(100)); create view test_col_drp_vw1 as select col1 col1_vw1, col2 col2_vw1, col3 col3_vw1 from test_col_drp; create…
Vikram
  • 347
  • 1
  • 3
  • 8
2
votes
1 answer

Recreate subfolders during a FOR /R LOOP batch command?

so I'm writing a script to scan mkv files and downconvert any 1080p files to 720p. I'm currently running through each file using a "for /r" loop to include subfolders. Is there a way I can recreate the subfolders into the output destination? Here's…
Jason
  • 21
  • 2
1
2
3
8 9