Reputation: 129
I'm using a MainActivity that links to many activies. The first time that you push on a button from the MainActivity to go to another activity, it takes 2-3 seconds to load. After the first time, you can do everything by loading activities in less than 1 second (as I expected).
I don't know how to solve this, since I'm new in Android Studio and in the stack trace there isn't something that could make me understand the problem.
Here is the stack trace:
2021-01-23 00:56:08.641 31264-31303/it.iovara.trainassistant V/FA: onActivityCreated
2021-01-23 00:56:08.768 31264-31335/it.iovara.trainassistant V/FA: Connecting to remote service
2021-01-23 00:56:08.814 31264-31335/it.iovara.trainassistant V/FA: Activity paused, time: 10927315
2021-01-23 00:56:08.969 31264-31278/it.iovara.trainassistant I/.trainassistan: Background concurrent copying GC freed 73702(5097KB) AllocSpace objects, 51(1688KB) LOS objects, 49% free, 5696KB/11MB, paused 4.902ms total 226.422ms
2021-01-23 00:56:09.015 31264-31335/it.iovara.trainassistant V/FA: Connection attempt already in progress
2021-01-23 00:56:09.162 31264-31264/it.iovara.trainassistant I/WebViewFactory: Loading com.google.android.webview version 83.0.4103.106 (code 410410681)
2021-01-23 00:56:09.168 31264-31264/it.iovara.trainassistant I/.trainassistan: The ClassLoaderContext is a special shared library.
2021-01-23 00:56:09.170 31264-31264/it.iovara.trainassistant D/nativeloader: classloader namespace configured for unbundled product apk. library_path=/product/app/WebViewGoogle/lib/x86:/product/app/WebViewGoogle/WebViewGoogle.apk!/lib/x86:/product/app/TrichromeLibrary/TrichromeLibrary.apk!/lib/x86:/product/lib:/system/product/lib
2021-01-23 00:56:09.190 31264-31264/it.iovara.trainassistant I/.trainassistan: The ClassLoaderContext is a special shared library.
2021-01-23 00:56:09.192 31264-31264/it.iovara.trainassistant D/nativeloader: classloader namespace configured for unbundled product apk. library_path=/product/app/WebViewGoogle/lib/x86:/product/app/WebViewGoogle/WebViewGoogle.apk!/lib/x86:/product/app/TrichromeLibrary/TrichromeLibrary.apk!/lib/x86:/product/lib:/system/product/lib
2021-01-23 00:56:09.239 31264-31264/it.iovara.trainassistant I/cr_LibraryLoader: Loaded native library version number "83.0.4103.106"
2021-01-23 00:56:09.244 31264-31264/it.iovara.trainassistant I/cr_CachingUmaRecorder: Flushed 3 samples from 3 histograms.
2021-01-23 00:56:09.513 31264-31576/it.iovara.trainassistant W/.trainassistan: Accessing hidden method Landroid/media/AudioManager;->getOutputLatency(I)I (greylist, reflection, allowed)
2021-01-23 00:56:09.519 31264-31594/it.iovara.trainassistant D/HostConnection: HostConnection::get() New Host Connection established 0xe9dba1c0, tid 31594
2021-01-23 00:56:09.537 31264-31594/it.iovara.trainassistant D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_2
2021-01-23 00:56:09.537 31264-31594/it.iovara.trainassistant E/chromium: [ERROR:gl_surface_egl.cc(549)] eglChooseConfig failed with error EGL_SUCCESS
2021-01-23 00:56:09.545 31264-31576/it.iovara.trainassistant W/cr_media: Requires BLUETOOTH permission
2021-01-23 00:56:09.587 31264-31594/it.iovara.trainassistant D/EGL_emulation: eglCreateContext: 0xe9dbe600: maj 2 min 0 rcv 2
2021-01-23 00:56:09.590 31264-31594/it.iovara.trainassistant D/EGL_emulation: eglMakeCurrent: 0xe9dbe600: ver 2 0 (tinfo 0xb6947c30) (first time)
2021-01-23 00:56:09.597 31264-31264/it.iovara.trainassistant I/Ads: This request is sent from a test device.
2021-01-23 00:56:09.637 31264-31594/it.iovara.trainassistant E/chromium: [ERROR:gl_surface_egl.cc(549)] eglChooseConfig failed with error EGL_SUCCESS
2021-01-23 00:56:09.760 31264-31594/it.iovara.trainassistant I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es
2021-01-23 00:56:09.765 31264-31594/it.iovara.trainassistant W/cr_MediaCodecUtil: HW encoder for video/avc is not available on this device.
2021-01-23 00:56:09.770 31264-31594/it.iovara.trainassistant D/EGL_emulation: eglCreateContext: 0xe9dbe9f0: maj 2 min 0 rcv 2
2021-01-23 00:56:09.857 31264-31539/it.iovara.trainassistant D/zzez: File /data/user/0/it.iovara.trainassistant/cache/1598581401714.dex not found. No need for deletion
2021-01-23 00:56:09.878 31264-31264/it.iovara.trainassistant I/DynamiteModule: Considering local module com.google.android.gms.ads.dynamite:0 and remote module com.google.android.gms.ads.dynamite:21400
2021-01-23 00:56:09.878 31264-31264/it.iovara.trainassistant I/DynamiteModule: Selected remote version of com.google.android.gms.ads.dynamite, version >= 21400
2021-01-23 00:56:09.878 31264-31264/it.iovara.trainassistant V/DynamiteModule: Dynamite loader version >= 2, using loadModule2NoCrashUtils
2021-01-23 00:56:10.058 31264-31264/it.iovara.trainassistant D/OneSignal: onActivityResumed: it.iovara.trainassistant.ScmtActivity@406e04
2021-01-23 00:56:10.059 31264-31264/it.iovara.trainassistant D/OneSignal: curActivity is NOW: it.iovara.trainassistant.ScmtActivity:it.iovara.trainassistant.ScmtActivity@406e04
2021-01-23 00:56:10.059 31264-31264/it.iovara.trainassistant D/OneSignal: ActivityLifecycleHandler handleFocus, with runnable: null nextResumeIsFirstActivity: false
2021-01-23 00:56:10.059 31264-31264/it.iovara.trainassistant D/OneSignal: ActivityLifecycleHandler cancel background lost focus sync task
2021-01-23 00:56:10.059 31264-31264/it.iovara.trainassistant D/OneSignal: OSFocusDelaySync cancel background sync
2021-01-23 00:56:10.064 31264-31335/it.iovara.trainassistant V/FA: Activity resumed, time: 10928837
2021-01-23 00:56:10.168 31264-31264/it.iovara.trainassistant I/Choreographer: Skipped 93 frames! The application may be doing too much work on its main thread.
2021-01-23 00:56:10.382 31264-31327/it.iovara.trainassistant I/OpenGLRenderer: Davey! duration=1748ms; Flags=1, IntendedVsync=10927380363225, Vsync=10928930363163, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=10928945877340, AnimationStart=10928945912740, PerformTraversalsStart=10928946550640, DrawStart=10929028047840, SyncQueued=10929035843640, SyncStart=10929066724040, IssueDrawCommandsStart=10929066991540, SwapBuffers=10929073159140, FrameCompleted=10929159823940, DequeueBufferDuration=859000, QueueBufferDuration=1477300, GpuCompleted=72904454231491230,
2021-01-23 00:56:10.893 31264-31264/it.iovara.trainassistant D/OneSignal: onActivityStopped: it.iovara.trainassistant.MainActivity@6210aa4
2021-01-23 00:56:10.893 31264-31264/it.iovara.trainassistant D/OneSignal: curActivity is NOW: it.iovara.trainassistant.ScmtActivity:it.iovara.trainassistant.ScmtActivity@406e04
2021-01-23 00:56:11.030 31264-31335/it.iovara.trainassistant V/FA: Connection attempt already in progress
2021-01-23 00:56:11.031 31264-31335/it.iovara.trainassistant V/FA: Connection attempt already in progress
2021-01-23 00:56:11.033 31264-31335/it.iovara.trainassistant D/FA: Connected to remote service
2021-01-23 00:56:11.034 31264-31335/it.iovara.trainassistant V/FA: Processing queued up service tasks: 4
2021-01-23 00:56:11.235 31264-31541/it.iovara.trainassistant W/Ads: Not retrying to fetch app settings
2021-01-23 00:56:12.063 31264-31586/it.iovara.trainassistant E/chromium: [ERROR:cookie_manager.cc(137)] Strict Secure Cookie policy does not allow setting a secure cookie for http://googleads.g.doubleclick.net/ for apps targeting >= R. Please either use the 'https:' scheme for this URL or omit the 'Secure' directive in the cookie value.
2021-01-23 00:56:12.253 31264-31278/it.iovara.trainassistant I/.trainassistan: Background young concurrent copying GC freed 46336(3407KB) AllocSpace objects, 23(640KB) LOS objects, 38% free, 7054KB/11MB, paused 1.344ms total 115.113ms
I saw this question to solve the issue about AdMob but I don't understand what they mean for "remove all ad from back button" and I cannot post a comment.
Here is the layout from fragment_home.xml (I'm using the MainActivity with the navigation drawer):
<androidx.cardview.widget.CardView
android:foreground="?android:attr/selectableItemBackground"
android:clickable="true"
android:id="@+id/card_1"
android:layout_width="160dp"
android:layout_height="190dp"
android:layout_margin="10dp"
android:backgroundTint="?attr/colorBackgroundCardHome"
android:onClick="Card2">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center">
<ImageView
android:layout_width="64dp"
android:layout_height="64dp"
android:background="@drawable/cerchiobackazzurro"
android:src="@drawable/scmt"
android:padding="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textColor="?attr/colorTitoloCardHome"
android:layout_marginTop="10dp"
android:text="Title here"/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/lightgray"
android:layout_margin="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="description here"
android:padding="5dp"
android:textColor="?attr/colorTextCardHome" />
</LinearLayout>
</androidx.cardview.widget.CardView>
Here is the MainActivity code:
public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener {
public static final String PREFS_NAME = "prefences";
public Integer AlertStyle = R.style.Theme_AlertLight;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SharedPreferences imptema = getSharedPreferences("mypref", 0);
boolean temaDark = imptema.getBoolean("temaDark", false);
if (temaDark) {
setTheme(R.style.darktheme_NoActionBar);
AlertStyle = R.style.Theme_AlertDark;
}
setContentView(R.layout.activity_main);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
FloatingActionButton fab = findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Non implementata", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
});
DrawerLayout drawer = findViewById(R.id.drawer_layout);
NavigationView navigationView = findViewById(R.id.nav_view);
navigationView.getMenu().getItem(0).setChecked(true);
navigationView.setCheckedItem(R.id.nav_home);
if (temaDark) {
//White title
Menu menu = navigationView.getMenu();
MenuItem titolohd= menu.findItem(R.id.titolohd);
MenuItem trainass= menu.findItem(R.id.trainass);
SpannableString s = new SpannableString(titolohd.getTitle());
SpannableString ss = new SpannableString(trainass.getTitle());
s.setSpan(new TextAppearanceSpan(this, R.style.TextAppearance44), 0, s.length(), 0);
ss.setSpan(new TextAppearanceSpan(this, R.style.TextAppearance44), 0, ss.length(), 0);
titolohd.setTitle(s);
trainass.setTitle(ss);
navigationView.setNavigationItemSelectedListener(this);
}
// Passing each menu ID as a set of Ids because each
// menu should be considered as top level destinations.
mAppBarConfiguration = new AppBarConfiguration.Builder(
R.id.nav_home)
.setDrawerLayout(drawer)
.build();
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
NavigationUI.setupActionBarWithNavController(this, navController, mAppBarConfiguration);
NavigationUI.setupWithNavController(navigationView, navController);
FragmentTransaction fragmentTransaction=getSupportFragmentManager().beginTransaction();
fragmentTransaction.add(R.id.nav_host_fragment, new HomeFragment());
fragmentTransaction.commit();
SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);
boolean dialogShown = settings.getBoolean("dialogShown", false);
if (!dialogShown) {
dialog(); //call terms and conditions dialog
}
}
public View Card2(View view) {
Intent intent = new Intent(MainActivity.this, SecondActivity.class);
startActivity(intent);
return view;
}
}
SecondActivity
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//Imposto il tema base
SharedPreferences imptema = getSharedPreferences("mypref", 0);
boolean temaDark = imptema.getBoolean("temaDark", false);
//Theme here
if (!temaDark) {
//Non fare nulla
} else {
setTheme(R.style.darktheme);
AlertStyle = R.style.Theme_AlertDark;
}
setContentView(R.layout.activity_second);
MobileAds.initialize(this);
mAdView = findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);
getSupportActionBar().setTitle("Tile here");
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
//Impostazioni per la ricerca
Bundle extras = getIntent().getExtras();
if (extras != null) {
String difficulty= extras.getString("methodName");
if (difficulty.equals("call1")) {
call1();
} else if (difficulty.equals("call2")) {
call2();
} else if (difficulty.equals("call3")) {
call3();
} else if (difficulty.equals("call4")) {
call4();
}
}
}
Updated stack trace:
2021-01-26 13:02:07.647 11958-12060/it.iovara.trainassistant V/FA: Activity paused, time: 46555599
2021-01-26 13:02:07.743 11958-11987/it.iovara.trainassistant I/.trainassistan: Background concurrent copying GC freed 74026(5088KB) AllocSpace objects, 57(2000KB) LOS objects, 49% free, 5793KB/11MB, paused 2.819ms total 273.863ms
2021-01-26 13:02:07.784 11958-12060/it.iovara.trainassistant V/FA: Connecting to remote service
2021-01-26 13:02:07.903 11958-11958/it.iovara.trainassistant I/WebViewFactory: Loading com.google.android.webview version 83.0.4103.106 (code 410410681)
2021-01-26 13:02:07.910 11958-11958/it.iovara.trainassistant I/.trainassistan: The ClassLoaderContext is a special shared library.
2021-01-26 13:02:07.912 11958-11958/it.iovara.trainassistant D/nativeloader: classloader namespace configured for unbundled product apk. library_path=/product/app/WebViewGoogle/lib/x86:/product/app/WebViewGoogle/WebViewGoogle.apk!/lib/x86:/product/app/TrichromeLibrary/TrichromeLibrary.apk!/lib/x86:/product/lib:/system/product/lib
2021-01-26 13:02:07.929 11958-11958/it.iovara.trainassistant I/.trainassistan: The ClassLoaderContext is a special shared library.
2021-01-26 13:02:07.931 11958-11958/it.iovara.trainassistant D/nativeloader: classloader namespace configured for unbundled product apk. library_path=/product/app/WebViewGoogle/lib/x86:/product/app/WebViewGoogle/WebViewGoogle.apk!/lib/x86:/product/app/TrichromeLibrary/TrichromeLibrary.apk!/lib/x86:/product/lib:/system/product/lib
2021-01-26 13:02:07.980 11958-11958/it.iovara.trainassistant I/cr_LibraryLoader: Loaded native library version number "83.0.4103.106"
2021-01-26 13:02:07.980 11958-11958/it.iovara.trainassistant I/cr_CachingUmaRecorder: Flushed 3 samples from 3 histograms.
2021-01-26 13:02:08.325 11958-12229/it.iovara.trainassistant W/.trainassistan: Accessing hidden method Landroid/media/AudioManager;->getOutputLatency(I)I (greylist, reflection, allowed)
2021-01-26 13:02:08.343 11958-12229/it.iovara.trainassistant W/cr_media: Requires BLUETOOTH permission
2021-01-26 13:02:08.352 11958-12250/it.iovara.trainassistant D/HostConnection: HostConnection::get() New Host Connection established 0xe9db9900, tid 12250
2021-01-26 13:02:08.387 11958-12250/it.iovara.trainassistant D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_2
2021-01-26 13:02:08.387 11958-12250/it.iovara.trainassistant E/chromium: [ERROR:gl_surface_egl.cc(549)] eglChooseConfig failed with error EGL_SUCCESS
2021-01-26 13:02:08.407 11958-11958/it.iovara.trainassistant I/Ads: This request is sent from a test device.
2021-01-26 13:02:08.432 11958-12250/it.iovara.trainassistant D/EGL_emulation: eglCreateContext: 0xe9db90b0: maj 2 min 0 rcv 2
2021-01-26 13:02:08.435 11958-12250/it.iovara.trainassistant D/EGL_emulation: eglMakeCurrent: 0xe9db90b0: ver 2 0 (tinfo 0xb8f5b190) (first time)
2021-01-26 13:02:08.518 11958-12250/it.iovara.trainassistant E/chromium: [ERROR:gl_surface_egl.cc(549)] eglChooseConfig failed with error EGL_SUCCESS
2021-01-26 13:02:08.607 11958-12250/it.iovara.trainassistant I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es
2021-01-26 13:02:08.613 11958-12250/it.iovara.trainassistant W/cr_MediaCodecUtil: HW encoder for video/avc is not available on this device.
2021-01-26 13:02:08.639 11958-12250/it.iovara.trainassistant D/EGL_emulation: eglCreateContext: 0xe9dbb9d0: maj 2 min 0 rcv 2
2021-01-26 13:02:08.719 11958-11958/it.iovara.trainassistant I/DynamiteModule: Considering local module com.google.android.gms.ads.dynamite:0 and remote module com.google.android.gms.ads.dynamite:21400
2021-01-26 13:02:08.719 11958-11958/it.iovara.trainassistant I/DynamiteModule: Selected remote version of com.google.android.gms.ads.dynamite, version >= 21400
2021-01-26 13:02:08.719 11958-11958/it.iovara.trainassistant V/DynamiteModule: Dynamite loader version >= 2, using loadModule2NoCrashUtils
2021-01-26 13:02:08.768 11958-12197/it.iovara.trainassistant D/zzez: File /data/user/0/it.iovara.trainassistant/cache/1598581401714.dex not found. No need for deletion
2021-01-26 13:02:08.879 11958-11958/it.iovara.trainassistant D/OneSignal: onActivityResumed: it.iovara.trainassistant.ScmtActivity@3c4ba17
2021-01-26 13:02:08.880 11958-12060/it.iovara.trainassistant V/FA: Activity resumed, time: 46557024
2021-01-26 13:02:08.880 11958-11958/it.iovara.trainassistant D/OneSignal: curActivity is NOW: it.iovara.trainassistant.ScmtActivity:it.iovara.trainassistant.ScmtActivity@3c4ba17
2021-01-26 13:02:08.880 11958-11958/it.iovara.trainassistant D/OneSignal: ActivityLifecycleHandler handleFocus, with runnable: null nextResumeIsFirstActivity: false
2021-01-26 13:02:08.880 11958-11958/it.iovara.trainassistant D/OneSignal: ActivityLifecycleHandler cancel background lost focus sync task
2021-01-26 13:02:08.880 11958-11958/it.iovara.trainassistant D/OneSignal: OSFocusDelaySync cancel background sync
2021-01-26 13:02:09.005 11958-11958/it.iovara.trainassistant I/Choreographer: Skipped 92 frames! The application may be doing too much work on its main thread.
2021-01-26 13:02:09.017 11958-12048/it.iovara.trainassistant I/OpenGLRenderer: Davey! duration=1551ms; Flags=0, IntendedVsync=46555612337501, Vsync=46557145670773, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=46557152575000, AnimationStart=46557152636900, PerformTraversalsStart=46557153596500, DrawStart=46557154900700, SyncQueued=46557155976000, SyncStart=46557156930500, IssueDrawCommandsStart=46557157121400, SwapBuffers=46557160097900, FrameCompleted=46557164902000, DequeueBufferDuration=1111100, QueueBufferDuration=2236200, GpuCompleted=0,
2021-01-26 13:02:09.300 11958-12048/it.iovara.trainassistant I/OpenGLRenderer: Davey! duration=1766ms; Flags=1, IntendedVsync=46555612337501, Vsync=46557145670773, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=46557152575000, AnimationStart=46557152636900, PerformTraversalsStart=46557153596500, DrawStart=46557293466600, SyncQueued=46557305207200, SyncStart=46557374017500, IssueDrawCommandsStart=46557374790100, SwapBuffers=46557394717800, FrameCompleted=46557447355100, DequeueBufferDuration=781800, QueueBufferDuration=2950500, GpuCompleted=46545730326400,
2021-01-26 13:02:09.819 11958-11958/it.iovara.trainassistant D/OneSignal: onActivityStopped: it.iovara.trainassistant.MainActivity@cb8646b
2021-01-26 13:02:09.820 11958-11958/it.iovara.trainassistant D/OneSignal: curActivity is NOW: it.iovara.trainassistant.ScmtActivity:it.iovara.trainassistant.ScmtActivity@3c4ba17
2021-01-26 13:02:09.841 11958-12072/it.iovara.trainassistant D/OneSignal: UserStateSynchronizer internalSyncUserState from session call: false jsonBody: null
2021-01-26 13:02:09.974 11958-12306/it.iovara.trainassistant W/Ads: Not retrying to fetch app settings
2021-01-26 13:02:10.137 11958-12060/it.iovara.trainassistant V/FA: Connection attempt already in progress
2021-01-26 13:02:10.138 11958-12060/it.iovara.trainassistant V/FA: Connection attempt already in progress
2021-01-26 13:02:10.138 11958-12060/it.iovara.trainassistant D/FA: Connected to remote service
2021-01-26 13:02:10.139 11958-12060/it.iovara.trainassistant V/FA: Processing queued up service tasks: 3
Upvotes: 0
Views: 1561
Reputation: 129
I solved the issue by myself. Trough the Profiler I just noticed that is AdMob that requires too much time to load making my activity slower.
Upvotes: 1
Reputation: 746
In the above stacktrace, please read this warning:
2021-01-23 00:56:10.168 31264-31264/it.iovara.trainassistant I/Choreographer: Skipped 93 frames! The application may be doing too much work on its main thread.
This means that, you need to refactor your code such to ensure that minimal work is being done on main thread.
It seems that, your Main Activity
OR the logic behind the 'Button` which navigates to another activity consist of long operations.
If you have any heavy work/calculations in your code then use background thread.
Cleanup the code in your both activity and button click logic and then your transition will be quick and smooth.
Upvotes: 0