我想从静态成员函数中获取变量,这些变量来自另一个类,储存在MainActivity的普通变量中,但是引发了程序奔溃。我需要使用存在于静态成员函数中的字符串。如何解决这个问题?
public static void updateMessageBox(String mobileNum12, String mobileMessa12)
{
smsClass.function(mobileNum12); // smsClass was the Class name and here i created an object like " static SMS smsClass = new SMS(); "
}
public void function(String getString)
{
String data = getString; // here i need to get value from " getstring to get" how is it possible?
}
我能调用函数但是获取不到字符串的值。