0

I created an application to protect children and allow parents to control the access to the application.

It is a launcher with two profiles: Parent and child.

  • Parents have administrative rights and can select applications from a list view.

  • After the selection of applications, that list shall be saved in a file stored internally.

  • After that App should normally return to MainActivity. But during returning to MainActivity, the update does not happen!!

  • After debugging, I noticed that the above process failed and also confirmed the issue by the method of reading application files.

I do not know what to do! Do I restart my Activity or I use sharedPreferences for recording applications.

Please help!

Daniel A.A. Pelsmaeker
  • 47,471
  • 20
  • 111
  • 157
diez
  • 125
  • 1
  • 5
  • 12

1 Answers1

0

You could use a method for updating. And use that method inside onActivityResult - Method.

E.g.:

 @Override
 protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    reload();
    super.onActivityResult(requestCode, resultCode, data);       
 }

private void reload(){ //update your stuff }

DuKes0mE
  • 1,101
  • 19
  • 30
  • CAn you give me an example of using such method. And what to put result codes requestcode – diez Apr 21 '13 at 12:44
  • [There you go :)](http://developer.android.com/reference/android/app/Activity.html#StartingActivities). You can define your own request and resultcodes. Also take a look [here](http://stackoverflow.com/a/10407192/2245646) – DuKes0mE Apr 21 '13 at 12:52