我想从静态方法中调用非静态方法:
Class SMS
{
public static void First_function()
{
SMS sms = new SMS();
sms.Second_function();
}
public void Second_function()
{
Toast.makeText(getApplicationContext(),"Hello",1).show(); // This i anable to display and cause crash
CallingCustomBaseAdapters(); //this was the adapter class and i anable to call this also
}
我可以调用 Second_function 但是不能获得 Toast 和 CallCustomBaseAdapter() 方法,然后就出现崩溃。
如何处理这个问题呢?