public class Functions extends Activity{
public class StatControl{
public void add_biletzakonchen(int t2, int questFail) {
SharedPreferences pref = getSharedPreferences("stat", MODE_PRIVATE); //Тут происходит ошибка
Editor ed = pref.edit();
//...//
ed.commit();
}
}
}
Functions.StatControl statControl = new Functions().new StatControl();
statControl.add_biletzakonchen(t2, questFail);
03-15 14:14:00.292: E/AndroidRuntime(10082): FATAL EXCEPTION: main
03-15 14:14:00.292: E/AndroidRuntime(10082): java.lang.IllegalStateException: Could not execute method of the activity
03-15 14:14:00.292: E/AndroidRuntime(10082): at android.view.View$1.onClick(View.java:3595)
03-15 14:14:00.292: E/AndroidRuntime(10082): at android.view.View.performClick(View.java:4088)
03-15 14:14:00.292: E/AndroidRuntime(10082): at android.view.View$PerformClick.run(View.java:16984)
03-15 14:14:00.292: E/AndroidRuntime(10082): at android.os.Handler.handleCallback(Handler.java:615)
03-15 14:14:00.292: E/AndroidRuntime(10082): at android.os.Handler.dispatchMessage(Handler.java:92)
03-15 14:14:00.292: E/AndroidRuntime(10082): at android.os.Looper.loop(Looper.java:137)
03-15 14:14:00.292: E/AndroidRuntime(10082): at android.app.ActivityThread.main(ActivityThread.java:4745)
03-15 14:14:00.292: E/AndroidRuntime(10082): at java.lang.reflect.Method.invokeNative(Native Method)
03-15 14:14:00.292: E/AndroidRuntime(10082): at java.lang.reflect.Method.invoke(Method.java:511)
03-15 14:14:00.292: E/AndroidRuntime(10082): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
03-15 14:14:00.292: E/AndroidRuntime(10082): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
03-15 14:14:00.292: E/AndroidRuntime(10082): at dalvik.system.NativeStart.main(Native Method)
03-15 14:14:00.292: E/AndroidRuntime(10082): Caused by: java.lang.reflect.InvocationTargetException
03-15 14:14:00.292: E/AndroidRuntime(10082): at java.lang.reflect.Method.invokeNative(Native Method)
03-15 14:14:00.292: E/AndroidRuntime(10082): at java.lang.reflect.Method.invoke(Method.java:511)
03-15 14:14:00.292: E/AndroidRuntime(10082): at android.view.View$1.onClick(View.java:3590)
03-15 14:14:00.292: E/AndroidRuntime(10082): ... 11 more
03-15 14:14:00.292: E/AndroidRuntime(10082): Caused by: java.lang.NullPointerException
03-15 14:14:00.292: E/AndroidRuntime(10082): at com.example.test3pdd61.Functions$StatControl.add_biletzakonchen(Functions.java:14)
03-15 14:14:00.292: E/AndroidRuntime(10082): at com.example.test3pdd61.TestingProcActivity.show_result(TestingProcActivity.java:512)
03-15 14:14:00.292: E/AndroidRuntime(10082): at com.example.test3pdd61.TestingProcActivity.push(TestingProcActivity.java:279)
03-15 14:14:00.292: E/AndroidRuntime(10082): at com.example.test3pdd61.TestingProcActivity.onClick(TestingProcActivity.java:204)
03-15 14:14:00.292: E/AndroidRuntime(10082): ... 14 more
03-15 14:14:01.662: I/Process(10082): Sending signal. PID: 10082 SIG: 9
03-15 14:14:01.772: E/Trace(10493): error opening trace file: No such file or directory (2)