Fixed a crash when switching fast to profile after loading the app.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package nl.myhyvesbookplus.tagram;
|
||||
|
||||
import android.app.Fragment;
|
||||
import android.app.FragmentManager;
|
||||
import android.app.FragmentTransaction;
|
||||
import android.content.Intent;
|
||||
@@ -15,7 +16,6 @@ import android.view.View;
|
||||
import com.google.firebase.auth.FirebaseAuth;
|
||||
|
||||
import nl.myhyvesbookplus.tagram.controller.DownloadClass;
|
||||
import nl.myhyvesbookplus.tagram.controller.PostUploader;
|
||||
import nl.myhyvesbookplus.tagram.controller.ProfilePictureUploader;
|
||||
|
||||
public class MainActivity extends AppCompatActivity implements
|
||||
@@ -104,11 +104,6 @@ public class MainActivity extends AppCompatActivity implements
|
||||
this.finish();
|
||||
}
|
||||
|
||||
// public void testCreatePost(View view) {
|
||||
// DownloadClass downloadClass = new DownloadClass();
|
||||
// downloadClass.getPosts();
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void ProfilePictureUpdated(Boolean success) {
|
||||
Log.d(TAG, "ProfilePictureUpdated: Ja ik luister naar je!");
|
||||
@@ -125,9 +120,10 @@ public class MainActivity extends AppCompatActivity implements
|
||||
@Override
|
||||
public void PostDownloaded() {
|
||||
FragmentManager fragmentManager = getFragmentManager();
|
||||
fragmentManager.findFragmentById(R.id.content);
|
||||
TimelineFragment frag = (TimelineFragment) fragmentManager.findFragmentById(R.id.content);
|
||||
frag.startList();
|
||||
Fragment frag = fragmentManager.findFragmentById(R.id.content);
|
||||
|
||||
if (frag instanceof TimelineFragment) {
|
||||
((TimelineFragment) frag).startList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user