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