मेरे पास एक ऐप है जहां साइन इन करने के बाद यह आपको स्वागत स्क्रीन पर फेंकता है। मैं जब देखने के लिए onResume आग एक टोस्ट डाल दिया, लेकिन यह भी आग onCreateऑनर्यूम() को क्यों कहा जाता है जब कोई गतिविधि शुरू होती है?
के बादprotected void onResume(){
super.onResume();
Database openHelper = new Database(this);//create new Database to take advantage of the SQLiteOpenHelper class
myDB2 = openHelper.getReadableDatabase(); // or getWritableDatabase();
myDB2=SQLiteDatabase.openDatabase("data/data/com.example.login2/databases/aeglea", null, SQLiteDatabase.OPEN_READONLY);//set myDB to aeglea
cur = fetchOption("SELECT * FROM user_login");//use above to execute SQL query
msg.setText("Username: "+cur.getString(cur.getColumnIndex("username"))
+"\nFull name: "+cur.getString(cur.getColumnIndex("name"))+" "+cur.getString(cur.getColumnIndex("last"))
+"\ne-mail: "+cur.getString(cur.getColumnIndex("email"))
+"\nAeglea id:"+cur.getString(cur.getColumnIndex("uid")));
Toast.makeText(getApplicationContext(), "RESUMED", Toast.LENGTH_SHORT).show();
}
यह आता है से:
//create new intent
Intent log = new Intent(getApplicationContext(), Welcome.class);
// Close all views before launching logged
log.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(log);
// Close Login Screen
finish();
मैं विस्मित कर रहा हूँ। कुछ अनुभव यहां दिया जा सकता कृपया
'onPause' या' onResume'? – zapl
@zapl क्षमा करें, मैं अपना प्रश्न संपादित करूंगा – MayTheSchwartzBeWithYou