- mongodb - 在 MongoDB mapreduce 中,如何展平值对象?
- javascript - 对象传播与 Object.assign
- html - 输入类型 ="submit"Vs 按钮标签它们可以互换吗?
- sql - 使用 MongoDB 而不是 MS SQL Server 的优缺点
我在一个项目上工作了几天并且工作正常。但是今天我在模拟器应用程序中运行我的应用程序,在启动屏幕上暂停而不进入主要 Activity 并且它显示错误:-执行停止不是恢复的 Activity
和ava.lang。 RuntimeException:执行停止未恢复的 Activity
我的 SplashScreen.java:-
public class SplashScreen extends AppCompatActivity {
private static int SPLASH_TIME_OUT = 3000;
Boolean flag = false;
public static Activity activity_splash;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.splash_screen);
}
public void onResume(){
super.onResume();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
Intent i = new Intent(SplashScreen.this, MainActivity.class);
startActivity(i);
finish();
}
}, SPLASH_TIME_OUT);
}
}
我的 Logcat:-
11-10 13:56:01.721 1995-1995/shoppingmazza.android.catalyst.com.shoppingmazza E/ActivityThread: Performing stop of activity that is not resumed: {shoppingmazza.android.catalyst.com.shoppingmazza/shoppingmazza.android.catalyst.com.shoppingmazza.activity.MainActivity}
11-10 13:56:01.721 1995-1995/shoppingmazza.android.catalyst.com.shoppingmazza E/ActivityThread: java.lang.RuntimeException: Performing stop of activity that is not resumed: {shoppingmazza.android.catalyst.com.shoppingmazza/shoppingmazza.android.catalyst.com.shoppingmazza.activity.MainActivity}
11-10 13:56:01.721 1995-1995/shoppingmazza.android.catalyst.com.shoppingmazza E/ActivityThread: at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:3465)
11-10 13:56:01.721 1995-1995/shoppingmazza.android.catalyst.com.shoppingmazza E/ActivityThread: at android.app.ActivityThread.handleStopActivity(ActivityThread.java:3550)
11-10 13:56:01.721 1995-1995/shoppingmazza.android.catalyst.com.shoppingmazza E/ActivityThread: at android.app.ActivityThread.-wrap20(ActivityThread.java)
11-10 13:56:01.721 1995-1995/shoppingmazza.android.catalyst.com.shoppingmazza E/ActivityThread: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1373)
11-10 13:56:01.721 1995-1995/shoppingmazza.android.catalyst.com.shoppingmazza E/ActivityThread: at android.os.Handler.dispatchMessage(Handler.java:102)
11-10 13:56:01.721 1995-1995/shoppingmazza.android.catalyst.com.shoppingmazza E/ActivityThread: at android.os.Looper.loop(Looper.java:148)
11-10 13:56:01.721 1995-1995/shoppingmazza.android.catalyst.com.shoppingmazza E/ActivityThread: at android.app.ActivityThread.main(ActivityThread.java:5417)
11-10 13:56:01.721 1995-1995/shoppingmazza.android.catalyst.com.shoppingmazza E/ActivityThread: at java.lang.reflect.Method.invoke(Native Method)
11-10 13:56:01.721 1995-1995/shoppingmazza.android.catalyst.com.shoppingmazza E/ActivityThread: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
11-10 13:56:01.721 1995-1995/shoppingmazza.android.catalyst.com.shoppingmazza E/ActivityThread: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
11-10 13:56:04.262 1995-1995/shoppingmazza.android.catalyst.com.shoppingmazza E/ActivityThread: Performing stop of activity that is not resumed: {shoppingmazza.android.catalyst.com.shoppingmazza/shoppingmazza.android.catalyst.com.shoppingmazza.activity.MainActivity}
11-10 13:56:04.262 1995-1995/shoppingmazza.android.catalyst.com.shoppingmazza E/ActivityThread: java.lang.RuntimeException: Performing stop of activity that is not resumed: {shoppingmazza.android.catalyst.com.shoppingmazza/shoppingmazza.android.catalyst.com.shoppingmazza.activity.MainActivity}
11-10 13:56:04.262 1995-1995/shoppingmazza.android.catalyst.com.shoppingmazza E/ActivityThread: at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:3465)
11-10 13:56:04.262 1995-1995/shoppingmazza.android.catalyst.com.shoppingmazza E/ActivityThread: at android.app.ActivityThread.handleStopActivity(ActivityThread.java:3550)
11-10 13:56:04.262 1995-1995/shoppingmazza.android.catalyst.com.shoppingmazza E/ActivityThread: at android.app.ActivityThread.-wrap20(ActivityThread.java)
11-10 13:56:04.262 1995-1995/shoppingmazza.android.catalyst.com.shoppingmazza E/ActivityThread: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1373)
11-10 13:56:04.262 1995-1995/shoppingmazza.android.catalyst.com.shoppingmazza E/ActivityThread: at android.os.Handler.dispatchMessage(Handler.java:102)
11-10 13:56:04.262 1995-1995/shoppingmazza.android.catalyst.com.shoppingmazza E/ActivityThread: at android.os.Looper.loop(Looper.java:148)
11-10 13:56:04.262 1995-1995/shoppingmazza.android.catalyst.com.shoppingmazza E/ActivityThread: at android.app.ActivityThread.main(ActivityThread.java:5417)
11-10 13:56:04.262 1995-1995/shoppingmazza.android.catalyst.com.shoppingmazza E/ActivityThread: at java.lang.reflect.Method.invoke(Native Method)
11-10 13:56:04.262 1995-1995/shoppingmazza.android.catalyst.com.shoppingmazza E/ActivityThread: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
11-10 13:56:04.262 1995-1995/shoppingmazza.android.catalyst.com.shoppingmazza E/ActivityThread: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
11-10 13:56:06.857 1995-1995/shoppingmazza.android.catalyst.com.shoppingmazza E/ActivityThread: Performing stop of activity that is not resumed: {shoppingmazza.android.catalyst.com.shoppingmazza/shoppingmazza.android.catalyst.com.shoppingmazza.activity.MainActivity}
11-10 13:56:06.857 1995-1995/shoppingmazza.android.catalyst.com.shoppingmazza E/ActivityThread: java.lang.RuntimeException: Performing stop of activity that is not resumed: {shoppingmazza.android.catalyst.com.shoppingmazza/shoppingmazza.android.catalyst.com.shoppingmazza.activity.MainActivity}
11-10 13:56:06.857 1995-1995/shoppingmazza.android.catalyst.com.shoppingmazza E/ActivityThread: at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:3465)
11-10 13:56:06.857 1995-1995/shoppingmazza.android.catalyst.com.shoppingmazza E/ActivityThread: at android.app.ActivityThread.handleStopActivity(ActivityThread.java:3550)
11-10 13:56:06.857 1995-1995/shoppingmazza.android.catalyst.com.shoppingmazza E/ActivityThread: at android.app.ActivityThread.-wrap20(ActivityThread.java)
11-10 13:56:06.857 1995-1995/shoppingmazza.android.catalyst.com.shoppingmazza E/ActivityThread: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1373)
11-10 13:56:06.857 1995-1995/shoppingmazza.android.catalyst.com.shoppingmazza E/ActivityThread: at android.os.Handler.dispatchMessage(Handler.java:102)
11-10 13:56:06.857 1995-1995/shoppingmazza.android.catalyst.com.shoppingmazza E/ActivityThread: at android.os.Looper.loop(Looper.java:148)
11-10 13:56:06.857 1995-1995/shoppingmazza.android.catalyst.com.shoppingmazza E/ActivityThread: at android.app.ActivityThread.main(ActivityThread.java:5417)
11-10 13:56:06.857 1995-1995/shoppingmazza.android.catalyst.com.shoppingmazza E/ActivityThread: at java.lang.reflect.Method.invoke(Native Method)
11-10 13:56:06.857 1995-1995/shoppingmazza.android.catalyst.com.shoppingmazza E/ActivityThread: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
11-10 13:56:06.857 1995-1995/shoppingmazza.android.catalyst.com.shoppingmazza E/ActivityThread: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
MainActivity.java:-
public class MainActivity extends AppCompatActivity implements FragmentDrawer.FragmentDrawerListener {
// flag for Internet connection status
Boolean isInternetPresent = false;
// Connection detector class
ConnectionDetector cd;
private static String TAG = MainActivity.class.getSimpleName();
AlertDialogManager alert = new AlertDialogManager();
// Session Manager Class
UserSessionManager session;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Session class instance
session = new UserSessionManager(getApplicationContext());
Toolbar mToolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(mToolbar);
getSupportActionBar().setTitle(null);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
cd = new ConnectionDetector(getApplicationContext());
isInternetPresent = cd.isConnectingToInternet();
// check for Internet status
if (isInternetPresent) {
FragmentDrawer drawerFragment = (FragmentDrawer)
getSupportFragmentManager().findFragmentById(R.id.fragment_navigation_drawer);
drawerFragment.setUp(R.id.fragment_navigation_drawer, (DrawerLayout) findViewById(R.id.drawer_layout), mToolbar);
drawerFragment.setDrawerListener(this);
// display the first navigation drawer view on app launch
displayView(0);
}
else {
alert.showAlertDialog(MainActivity.this, "No Internet Connection",
"You don't have internet connection.", false);
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch(item.getItemId()){
case R.id.action_search:
Intent search = new Intent(MainActivity.this,SearchActivity.class);
startActivity(search);
return true;
case R.id.login:
if(session.checkLogin())
finish();
else {
Intent intent = new Intent(MainActivity.this,MyAccount.class);
startActivity(intent);
}
return true;
case R.id.my_order:
alert.showAlertDialog(MainActivity.this,"Alert","This Page Under Maintenance",false);
return true;
case R.id.wishlist:
if(session.checkLogin()){
finish();
}
else {
Intent wishlistIntent = new Intent(MainActivity.this,WishList.class);
startActivity(wishlistIntent);
}
default:
return super.onOptionsItemSelected(item);
}
}
@Override
public void onDrawerItemSelected(View view, int position) {
displayView(position);
}
private void displayView(int position) {
Fragment fragment = null;
String title = getString(R.string.app_name);
switch (position) {
case 0:
/* fragment = new HomeFragment();
title = getString(R.string.title_home);*/
Intent intentHome = new Intent(MainActivity.this,MainActivity.class);
startActivity(intentHome);
break;
case 1:
Intent intent = new Intent(MainActivity.this,ShopByCategory.class);
startActivity(intent);
break;
case 2:
break;
case 3:
/* Intent intentTodayDeal = new Intent(MainActivity.this,TodayDeal.class);
startActivity(intentTodayDeal);*/
/*Intent intent = new Intent(MainActivity.this,ShopByCategory.class);
startActivity(intent);*/
break;
case 4:
Intent intentTrackYourOrder = new Intent(MainActivity.this,MainActivity.class);
startActivity(intentTrackYourOrder);
break;
case 5:
Intent intentLegal = new Intent(MainActivity.this,Legal.class);
startActivity(intentLegal);
break;
case 6:
break;
case 7:
break;
case 8:
break;
case 9:
break;
default:
break;
}
if (fragment != null) {
FragmentManager fragmentManager = getSupportFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.replace(R.id.container_body, fragment);
fragmentTransaction.commit();
// set the toolbar title
getSupportActionBar().setTitle(null);
getSupportActionBar().setLogo(R.drawable.ic_launcher);
}
}
}
最佳答案
在 MainActivity
的 onCreate
中,如果可以访问互联网,您将调用 displayView(0);
。在 displayView
中,
case 0:
Intent intentHome = new Intent(MainActivity.this,MainActivity.class);
startActivity(intentHome);
break;
在这里,您再次启动 MainActivity
,因此应用程序陷入了无限循环。最终它崩溃了。
关于java.lang.RuntimeException : Performing stop of activity that is not resumed in android,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33626151/
我的几个 Android 应用程序在 logcat 输出中显示以下类型的消息: I/UsageStats( 59): Unexpected resume of com.totsp.test whi
因此,在“On Error GoTo 执行一次”下出现了几个 SO 问题和 Google 结果,几乎在每种情况下,推荐的解决方案都是添加 Err.Clear或者Resume的一些论坛清除错误。 VBA
我正在构建一个基于文本的 RPG,并且我已经成功地向我的程序添加了一些 .wav 文件,我也能够正常播放它们而没有问题任何一个。 目前发生了什么? 我有 2 个 .wav 文件,一个用于一般背景音乐
在那里, 我修改了 Lua 5.0 在线文档中的“perm”示例:http://www.lua.org/pil/9.3.html .我所做的是将 __call() 元方法重新指向 perm() 函数。
我意识到这是一个较旧的编程环境,但我必须清理一些 VB6代码,我发现它大部分使用: On Error Resume Next 使用On Error Resume Next的普遍共识是什么? ? 当然,
当我尝试恢复挂起(可恢复)编排实例时,出现以下错误。 场景:请求通过 DB2 静态请求 - 响应端口,但由于访问权限被拒绝而失败。我可以在管理控制台中看到两个暂停的实例,一个与端口相关,另一个与编排相
如何从最后上传的 block 中获取响应数据?我在任何地方都找不到它,我唯一发现的是您只能在错误时访问该消息 谢谢 最佳答案 找到了!如果您想从上传的文件中检索数据,您需要: r.on('fi
我无法建立exe: 1> ------ Assembly started: project: B, Configuration: Debug Any CPU B.vb (38.9): error BC
我在 aframe (ar.js) 中有一个 360° 旋转动画,我想暂停并继续它,而我所能做的就是暂停但从头开始重新开始。 Animation docum
我认为答案是否定的,但 Twilio 是否提供暂停/恢复录制的功能?用例正在录制通话,但在收集敏感信息时暂停录制。从 REST 文档来看,它似乎不是受支持的功能。认为有人可能已经找到了满足此要求的一些
我有一个包含 5 个模块的多模块 maven 项目。这些模块是分层的,因此一些依赖于构建的第一个(它是我的模型类),而一些依赖于构建的第二个(那些是核心应用程序类)。最后一个构建的是一个依赖于所有其他
如果我运行一个异步调用 onResume 是否有一个好的方法来检测异步调用是否正在运行以不再调用它? 因为我在 fragment 的 onResume 中使用 AsynTask 进行网络调用,它似乎被
如何向这个 javascript 倒数计时器添加恢复按钮? JS $(document).ready(function () { var $worked = $("#timer"); function
找不到明确的答案,基本上我有一个 EditText 字段的 Activity 。软键盘在 list 中设置为可见,因此当 Activity 开始时键盘是可见的,但是如果用户导航离开并使用后退按钮返回,
我正在看generators in Rust ,并决定试一试。我实现了我能找到的最基本的例子: #![feature(generators, generator_trait)] use std::op
我知道这之前已经发布过,但我是 swift 的新手,我想根据我的情况寻求帮助。所以我需要运行一个计时器,当 stopMusic() 被调用时(在我的应用程序中的某个地方),我需要暂停计时器,然后当 p
Android 中的共享首选项有问题 - 我希望能够将一些字符串(保存图片的 ID)作为下一次发布的最爱 - 它工作完美,它可以识别 ID 是否已经在共享首选项并在必要时将其删除,但是当我通过按下主页
我在我的 Node.js-express 应用程序中使用 Resumable.js。我可以知道文件传输成功了,因为我可以 console.log(req.body) 并在下面看到这个...... {
一年好景君须记,最是橙黄橘绿时。金三银四,秣马厉兵,没有一个好看的简历模板怎么行?无论是网上随便下载还是花钱买,都是一律千篇的老式模版,平平无奇,味同嚼蜡,没错,蜡都要沿着嘴角流下来了。本次我们基于
启用或禁用错误处理程序。 说明 如果在您的代码中未使用OnErrorResumeNext语句,所发生的运行时错误将显示错误信息,同时,代码的执行也随之终止。但是具体操作由运行代码的主机决定。主机
我是一名优秀的程序员,十分优秀!