调用onCreate()方法后,我的模拟器和手机的屏幕变黑,之后的代码无法启动。它不会抛出任何错误,只是在OnCcreate方法的最后一行停止。我认为它在Actvity.java文件中停止。 log cat
02-10 14:00:08.660 2794-2794/com.flashcards.flashcards D/﹕ HostConnection::get() New Host Connection established 0x7ff02f1974a0, tid 2794
02-10 14:00:08.670 2794-2794/com.flashcards.flashcards D/Atlas﹕ Validating map...
02-10 14:00:08.710 2794-2813/com.flashcards.flashcards D/﹕ HostConnection::get() New Host Connection established 0x7ff02f197de0, tid 2813
02-10 14:00:08.740 2794-2813/com.flashcards.flashcards I/OpenGLRenderer﹕ Initialized EGL, version 1.4
02-10 14:00:08.780 2794-2813/com.flashcards.flashcards D/OpenGLRenderer﹕ Enabling debug mode 0
02-10 14:00:08.800 2794-2813/com.flashcards.flashcards W/EGL_emulation﹕ eglSurfaceAttrib not implemented
02-10 14:00:08.800 2794-2813/com.flashcards.flashcards W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0x7ff0398bed00, error=EGL_SUCCESS
02-10 14:00:10.030 2794-2813/com.flashcards.flashcards W/EGL_emulation﹕ eglSurfaceAttrib not implemented
02-10 14:00:10.030 2794-2813/com.flashcards.flashcards W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0x7ff02e6fa940, error=EGL_SUCCESS
02-10 14:00:10.260 2794-2813/com.flashcards.flashcards D/OpenGLRenderer﹕ endAllStagingAnimators on 0x7ff036d8dc00 (RippleDrawable) with handle 0x7ff02f1c15c0
有问题的方法
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_card_question);
try {
FileInputStream fis = openFileInput("correct2.txt");
//InputStreamReader isr = new InputStreamReader(fIn);
StringBuffer sb = new StringBuffer();
BufferedReader br = new BufferedReader(new InputStreamReader(fis));
String strLine = null;
int x = 0;
while ((strLine = br.readLine()) != null) {
arrayCorrect[x] = strLine;
x++;
}
if(x>0&&arrayCorrect[x-1]!=null) {
if (arrayCorrect[x - 1].equals("null") || arrayCorrect[x - 1].equals("")) {
errorInTranscription();
}
}
//Log.i("File Reading stuff", "success = " + "hell");
} catch (IOException ioe) {//ioe.printStackTrace();
}
try {
FileInputStream fis = openFileInput("incorrect2.txt");
//InputStreamReader isr = new InputStreamReader(fIn);
StringBuffer sb = new StringBuffer();
BufferedReader br = new BufferedReader(new InputStreamReader(fis));
String strLine = null;
int x = 0;
while ((strLine = br.readLine()) != null) {
arrayIncorrect[x] = strLine;
x++;
}
if(x>0&&arrayIncorrect[x-1]!=null) {
if(arrayIncorrect[x].equals("null")||arrayIncorrect[x].equals("")){
errorInTranscription();
}}
} catch (IOException ioe) {//ioe.printStackTrace();
}
int a=1;
}
它到达终点(int a = 1),但它只是停留在最后一个parathesis