我收到此错误:执行停止未恢复LoginActivity的活动.我已经阅读了有关此错误的其他主题,但我仍然无法看到问题所在.
这是我的Logcat:
java.lang.RuntimeException: Performing stop of activity that is not resumed: {package/package.LoginActivity}
at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:3333)
at android.app.ActivityThread.handleStopActivity(ActivityThread.java:3420)
at android.app.ActivityThread.access$1200(ActivityThread.java:161)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1292)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5356)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
at dalvik.system.NativeStart.main(Native Method)
Run Code Online (Sandbox Code Playgroud)
我的活动:
public class LoginActivity extends Activity {
EditText edtMail,edtPass;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
Button regButton = (Button) findViewById(R.id.registerbtn);
Button logButton = (Button) findViewById(R.id.login);
final Context context = getApplicationContext();
edtMail = (EditText) findViewById(R.id.email);
edtPass = (EditText) findViewById(R.id.pword);
// testing …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用getActionBar(); 方法,我收到此错误:需要android.support.v7.app.ActionBar找到android.app.ActionBar.我怎么能纠正这个?
我不知道如何在 Android 中获取位置(拍照时的 GPS/网络)。欢迎任何建议和代码示例。我直到现在还没有使用定位服务,我尝试了很多方法,但我无法让它工作。
这是我的图像捕获活动:
public class ImageCaptureActivity extends Activity {
// Activity request codes
private static final int CAMERA_CAPTURE_IMAGE_REQUEST_CODE = 100;
public static final int MEDIA_TYPE_IMAGE = 1;
Context context = null;
// directory name to store captured images
private static final String IMAGE_DIRECTORY_NAME = "Asisoft";
private Uri fileUri; // file url to store image
private ImageView imgPreview;
private Button btnCapturePicture;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.image_capture);
context = getApplicationContext();
imgPreview = (ImageView) findViewById(R.id.imgPreview);
btnCapturePicture = (Button) …Run Code Online (Sandbox Code Playgroud)