从安卓市场,我得到了以下崩溃报告。我在测试我的应用程序时没有找到。车祸发生在PasswordActivity
课堂上。我正在发送堆栈跟踪和代码。任何人都可以向我建议崩溃发生的位置以及为什么会发生这种情况?
堆栈跟踪
java.lang.IncompatibleClassChangeError: interface not implemented
at in.plackal.lovecyclesfree.PasswordActivity.onCreate(PasswordActivity.java)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
at android.app.ActivityThread.access$2300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)
at dalvik.system.NativeStart.main(Native Method)
我的代码
public class PasswordActivity extends Activity implements Utilities { //私有变量 private EditText m_passwrdEditText;
private TextView m_passwrdErrorText;
private Resources m_res;
@Override
public void onCreate(Bundle savedInstanceState) {
//Setup the activity
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm);
if (dm.widthPixels == 320 && dm.heightPixels == 480) {
setContentView(R.layout.password_activity_hvga);
} else {
setContentView(R.layout.password_activity);
}
GoogleAnalyticsTracker tracker = GoogleAnalyticsTracker.getInstance();;
tracker.startNewSession("UA-xxxxxxx-1", this);
tracker.trackPageView("Password");
tracker.dispatch();
m_res = getResources();
final Typeface face = Typeface.createFromAsset(getAssets(), "fonts/Cicle Semi.otf");
m_passwrdErrorText = (TextView) findViewById(R.id.txt_error_message);
m_passwrdErrorText.setTypeface(face);
m_passwrdEditText = (EditText) findViewById(R.id.txt_edit_passwrd);
m_passwrdEditText.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
m_passwrdEditText.setHint("");
m_passwrdEditText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
m_passwrdEditText.setTypeface(face);
}
});
m_passwrdEditText.setTypeface(face);
m_passwrdEditText.setOnKeyListener(new OnKeyListener() {
public boolean onKey(View v, int keyCode, KeyEvent event) {
if ((event.getAction() == KeyEvent.ACTION_DOWN) && (keyCode == KeyEvent.KEYCODE_ENTER)) {
String strPassEntered = m_passwrdEditText.getText().toString();
String strPassSaved = CycleManager.getSingletonObject().getPassWord();
m_passwrdEditText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
if (strPassSaved.equals(strPassEntered) || strPassEntered.equals(DEFAULT_PASSWORD)) {
Intent intent = new Intent(PasswordActivity.this, ActivityManager.class);
startActivity(intent);
PasswordActivity.this.finish();
} else {
m_passwrdErrorText.setText(m_res.getString(R.string.passwrd_error_text));
m_passwrdEditText.setFocusable(true);
}
} else if (keyCode == KeyEvent.KEYCODE_DEL) {
m_passwrdEditText.setHint(m_res.getString(R.string.passwrd_hint_text));
m_passwrdErrorText.setText("");
}
m_passwrdEditText.setTypeface(face);
return false;
}
});
}
}