• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Run a method from onCreate

jane2602

Lurker
Hello. How do I achieve method getLastRecord to run from within onCreate of an Activity class. (The getLastRecord methode calls a method in another class with extends SQLiteOpenHelper.). Any help with this?

Code:
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_info);
    // calls constructor of this databasehelperclass
    myDb = new DatabaseHelper(this);

    insertData();
    getLastRecord (???);???
}


public String[] getLastRecord (String[] test)
{
// does something
}
 
Last edited by a moderator:
It's a little unclear from your description and code, what it is exactly you're asking about.
From the question marks in your code, are you confused about the method parameters for your getLastRecord() method?
Do you want to to know how to call a method on another class?
Are you unsure how to create an instance of that class?
 
Back
Top Bottom