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

How to refresh previous fragment after closing an activity?

I have a fragment that throws an activity in which user can insert some details. When the user terminate to fill data the activity close. Then the previous fragment is showed and I want it to be updated (with the data provided by user in the…
smartmouse
  • 13,912
  • 34
  • 100
  • 166
2
votes
1 answer

makefile rebuilds static library even if nothing changed

I am doing a build system based on recursive(toxic but not matter) make. The main problem I have is that make recreates the libraries I instruct it to do even if there were no changes to an of the *o files. Here is the section in on of my makefiles…
weaz
  • 35
  • 8
2
votes
4 answers

Masonry destroy and initialize again

I have initialize masonry plugin - works OK, than I destroy it for media width <= 767px - it was destroyed but when I return back to media width > 767px and initialize masonry again it doesn't work. why? or is there any another solution to turn off…
quarky
  • 710
  • 2
  • 13
  • 36
2
votes
1 answer

java.lang.IllegalStateException: Could not execute method of the activity with Android

I'm a fairly new Android programmer, and after working through a couple of tutorials I began expanding upon the BMI Calculator tutorial I completed. During this process, it became necessary for me to delete and re-install Eclipse. I also had to…
1
vote
0 answers

UIView drawRect EXC_BAD_ACCESS on Recreate a Custon UIView

I having some problems with drawRect and create a new instance of a UIView custom class. My question is: How can i use of drawrect? I created a UIViewController with a UIScrollView and inside this UIScrollView about 50 UIViews. Each UIView create…
1
vote
0 answers

Android ActivityInjector: get life cycle exception after language change

In my android app I have a simple language switch between 2 languages. Everything is working fine, the language is switched well, but I noticed an error when debugging on real device, that was not there before (Xiaomi Redmi 9). It…
Darksymphony
  • 2,155
  • 30
  • 54
1
vote
0 answers

OnPause called after OnResume after calling recreate

I have app with 3 activities. Main Activity A Side Activity B Side Activity C From Main Activity I can go directly to B and C as well. All moves looks like that: A->B->C A->C A->B Ofc when I want go back when I'm in C I need to know that I came…
KyluAce
  • 933
  • 1
  • 8
  • 25
1
vote
1 answer

Re deploy Azure Virtual Machine

I made a mistake and I delete a virtual machine I need, This VM has a OS DISK in vhd file that I keep in the storage, is there any way to re-deploy the virtual machine using this OS DISK?, Thanks a lot!
1
vote
1 answer

how to change language at run time with out recreating activity

I used the below code for changing language from default to selected. But i am not able to update the views in my fragment/activity like TextView with selected language. Programmatically showing selected language. Also My Application is potrait…
Mano
  • 11
  • 3
1
vote
1 answer

Why is recommended to recreate the whole database schema for each test?

Its said that in order to execute database tests with Spring data(JPA) for example, its a good practice to recreate the whole database schema for each test in order to drop all the objects from database after the test and clean the whole environment…
fernando1979
  • 1,727
  • 2
  • 20
  • 26
1
vote
1 answer

Fragment not visible after when activity is recreated

I'm using a bottom navigation view with four fragments, to avoid recreation of fragments I'm using this code snippet: private void changeFragment(Fragment fragment, String tagFragmentName) { FragmentTransaction ft = fm.beginTransaction(); …
1
vote
2 answers

How to refresh an Activity from an Adapter in java

I have to update total price of the items selected in the cart activity by refreshing the activity when user updates the quantity of the items selected Total price method is in the MainActivity while the cart items selected is in the…
1
vote
1 answer

How to recreate buttons in previous activity?

I have a problem with code in Android Studio. I have ActivityA and ActivityB. In ActivityA I have buttons. ActivityB is about settings. For example, I can choose the theme of the app. All done using SharedPreferences. If I change theme to DARK with…
user11577128
1
vote
1 answer

JQuery: How to Redraw Slider?

I need your help desperately since I spent too much time trying to modify Jquery Slider Plugin with no success. I am using this slider plugin: http://blog.egorkhmelev.com/2010/03/jquery-slider-update/ What I am trying to do is to re-draw this…
Kelvin
  • 8,813
  • 11
  • 38
  • 36
1
vote
1 answer

Where do I put recreate() after changing a theme using preferences?

I have been trying to add a dark mode to my app and have mainly been using this site (Tutorial) to learn how to implement it. Everything works other than the theme does not change until I restart the app. After some research I have found that…
1 2
3
8 9