我在Android studio 0.3.7中创建了最简单的程序。
public class test extends Activity implements View.OnClickListener {
TextView tt;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_test);
Button button = (Button) findViewById(R.id.button);
tt = (TextView) findViewById(R.id.Sett);
button.setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch(v.getId()){
case R.id.button:
tt.setText("Running");
break;
}
}
}
但我的结果是我在logcat中发现错误。如何避免这个错误? 我试图找到解决方案,但没有找到。 另外我发现其他我的项目也有这个问题。
12-07 15:31:57.653 232-269/? E/ActivityManager﹕ mtprof entry can not found!
java.io.FileNotFoundException: /proc/mtprof/status: open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java:448)
at java.io.FileInputStream.<init>(FileInputStream.java:78)
at java.io.FileInputStream.<init>(FileInputStream.java:105)
at com.android.server.am.ActivityRecord.mtProf(ActivityRecord.java:852)
at com.android.server.am.ActivityRecord.windowsDrawn(ActivityRecord.java:653)
at com.android.server.am.ActivityRecord$Token.windowsDrawn(ActivityRecord.java:225)
at com.android.server.wm.WindowManagerService$H.handleMessage(WindowManagerService.java:6994)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:154)
at com.android.server.wm.WindowManagerService$WMThread.run(WindowManagerService.java:754)
Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)