When you make requests with StackMob, it will run in a different thread (not UI thread).
You will need to make sure that your code runs in a UI thread when you want to modify / touch / edit your UI.
Hence, in your success
method, you'll need to do:
runOnUiThread(new Runnable() {
@Override
public void run() {
setMyAppUser(loggedUserf);
}
});
Extra: It's best to have all of your activities to extend an activity (let's call it BaseActivity) that has:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (StackMob.getStackMob() == null)
StackMobAndroid.init(getApplicationContext(), 0, "XXXX");
}
Why? It's just to make sure that StackMob will always get initialized when you reopen your app (from foreground).