Hello everyone. I'm trying to start a floating activity from onStart to retrieve some info from the user right when the initial activity begins. I have the following:
@Override
public void onStart(){
super.onStart();
callProfileDialog();
}
And callProfileDialog()
is just:
private void callProfileDialog(){
Intent i = new Intent(this, com.utility.ProfileDialog.class);
startActivityForResult(i, PROFDIALOG);
}
ProfileDialog.class
returns a String from an input box. If the result returned is RESULT_CANCELED
then I restart the activity.
The problem I'm having is that when the program starts, the screen is just black. If I hit the Back button a RESULT_CANCELED
is returned then the initial activity shows as well as the floating activity (since it recalled itself when it got a RESULT_CANCELED
). Why can't I get the activities show by calling ProfileDialog.class
from onStart()? I got the same result when I called it at the end of onCreate() which is way I switch over to use onStart(). Thanks for the help.
Edit: I have also tried the following:
@Override
public void onWindowFocusChanged(boolean hasFocus){
if(hasFocus)
callProfileDialog();
}
But this doesn't work either. It all works fine once I hit the back button but without doing that, it's all black.