public class jar_layut extends Activity {
/** Called when the activity is first created. */
boolean out=false;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
new Thread(new Runnable()
{ public void run()
{
try {
out=first_check_pic_on_device();
mHandlerMySpace5.post(mUpdateResultsMySpace5);
} catch (Exception e) {
// TODO Auto-generated catch block
mHandlerMySpace5.post(mUpdateResultsMySpace5);
}
}
} ).start();
}
private boolean first_check_pic_on_device()
{
Context contextMySpace= this;;
try {
FileInputStream stream =contextMySpace.openFileInput("prf.png");
try {
return true;
} catch (Exception e) {
// TODO Auto-generated catch block
return false;
}
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
return false;
}
}
final Handler mHandlerMySpace5 = new Handler();
final Runnable mUpdateResultsMySpace5 = new Runnable() {
public void run() {
if(!out)
{
showDialog();
}
}
};
private void showDialog()
{
final CharSequence[] items = {"one", "two"};
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setSingleChoiceItems(items, -1, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int item) {
if(item==0)
{
}
if(item==1)
{
}
}
});
AlertDialog alert = builder.create();
alert.show();
}
}