Azure Mobile App: Android .get() causes app to freeze - android

I have a class User that has several attributes and a String called ID so that it matches my DB table called User. At the moment my table User is empty.
Whenever I try:
mClient.getTable(User.class).insert(myUser).get();
or
mClient.getTable(User.class).execute().get();
My app freezes on a white screen and console shows no error. The stackTrace or prints that i do in my catch clause never show up.
The only errors I get are:
06-08 23:23:35.287 28469-28469/t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
Here is the code I use in my onCreate Method for :
User myUser = new User();
// fill in myUser's fields but Id.
new Runnable() {
#Override
public void run() {
try {
User myUser2 = mClient.getTable(User.class).insert(myUser).get();
System.out.println("Successfully added the user !");
} catch (Exception e) {
e.printStackTrace();
}
}
}.run();
I am new to azure and I couldn't find any help with my friend google. Thanks in advance.
EDIT: Here is the whole logcat:
t2g.com.travel2gather I/art: Not late-enabling -Xcheck:jni (already on)
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather I/art: System.exit called, status: 1
t2g.com.travel2gather I/AndroidRuntime: VM exiting with result code 1, cleanup skipped.
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
t2g.com.travel2gather D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
[ 06-08 23:19:29.602 24915:24915 D/ ]
HostConnection::get() New Host Connection established 0xabead140, tid 24915
[ 06-08 23:19:29.665 24915:24962 D/ ]
HostConnection::get() New Host Connection established 0xa313a110, tid 24962
t2g.com.travel2gather I/OpenGLRenderer: Initialized EGL, version 1.4
t2g.com.travel2gather W/EGL_emulation: eglSurfaceAttrib not implemented
t2g.com.travel2gather W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa2cee100, error=EGL_SUCCESS
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
t2g.com.travel2gather D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
[ 06-08 23:21:25.518 26595:26595 D/ ]
HostConnection::get() New Host Connection established 0xabead0c0, tid 26595
[ 06-08 23:21:25.587 26595:26642 D/ ]
HostConnection::get() New Host Connection established 0xa3134130, tid 26642
t2g.com.travel2gather I/OpenGLRenderer: Initialized EGL, version 1.4
t2g.com.travel2gather W/EGL_emulation: eglSurfaceAttrib not implemented
t2g.com.travel2gather W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa2cc2220, error=EGL_SUCCESS
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/data/t2g.com.travel2gather/lib
t2g.com.travel2gather W/art: Suspending all threads took: 11.368ms
t2g.com.travel2gather E/Surface: getSlotFromBufferLocked: unknown buffer: 0xabea8b30
t2g.com.travel2gather I/Choreographer: Skipped 40 frames! The application may be doing too much work on its main thread.
t2g.com.travel2gather W/EGL_emulation: eglSurfaceAttrib not implemented
t2g.com.travel2gather W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa2cc2220, error=EGL_SUCCESS
t2g.com.travel2gather W/EGL_emulation: eglSurfaceAttrib not implemented
t2g.com.travel2gather W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa36a0480, error=EGL_SUCCESS
t2g.com.travel2gather E/Surface: getSlotFromBufferLocked: unknown buffer: 0xa2971570
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/data/t2g.com.travel2gather/lib
t2g.com.travel2gather W/EGL_emulation: eglSurfaceAttrib not implemented
t2g.com.travel2gather W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa227e720, error=EGL_SUCCESS
t2g.com.travel2gather W/art: Suspending all threads took: 10.473ms
t2g.com.travel2gather I/art: Not late-enabling -Xcheck:jni (already on)
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
t2g.com.travel2gather I/art: Background partial concurrent mark sweep GC freed 8584(1343KB) AllocSpace objects, 5(1600KB) LOS objects, 39% free, 3MB/6MB, paused 1.655ms total 226.868ms
t2g.com.travel2gather D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
[ 06-08 23:22:25.364 27456:27456 D/ ]
HostConnection::get() New Host Connection established 0xab6d42e0, tid 27456
t2g.com.travel2gather W/art: Verification of void com.squareup.okhttp.internal.http.HttpEngine.readResponse() took 169.113ms
[ 06-08 23:22:25.428 27456:27508 D/ ]
HostConnection::get() New Host Connection established 0xab6d48c0, tid 27508
t2g.com.travel2gather I/OpenGLRenderer: Initialized EGL, version 1.4
t2g.com.travel2gather W/EGL_emulation: eglSurfaceAttrib not implemented
t2g.com.travel2gather W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa37d7c80, error=EGL_SUCCESS
t2g.com.travel2gather W/art: Verification of okio.Source com.squareup.okhttp.internal.http.HttpConnection.newChunkedSource(com.squareup.okhttp.internal.http.HttpEngine) took 157.042ms
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/data/t2g.com.travel2gather/lib
t2g.com.travel2gather I/art: Background partial concurrent mark sweep GC freed 107958(3MB) AllocSpace objects, 1(240KB) LOS objects, 40% free, 4MB/6MB, paused 9.332ms total 199.896ms
t2g.com.travel2gather W/art: Suspending all threads took: 5.557ms
t2g.com.travel2gather I/art: Background sticky concurrent mark sweep GC freed 70224(2MB) AllocSpace objects, 6(364KB) LOS objects, 0% free, 7MB/7MB, paused 7.961ms total 76.058ms
t2g.com.travel2gather I/art: Background partial concurrent mark sweep GC freed 11587(629KB) AllocSpace objects, 5(2040KB) LOS objects, 39% free, 5MB/8MB, paused 5.417ms total 20.421ms
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather I/art: Background sticky concurrent mark sweep GC freed 14786(1156KB) AllocSpace objects, 1(20KB) LOS objects, 72% free, 1024KB/3MB, paused 19.184ms total 31.942ms
t2g.com.travel2gather W/art: Suspending all threads took: 5.952ms
t2g.com.travel2gather W/art: Suspending all threads took: 6.214ms
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather I/art: System.exit called, status: 1
t2g.com.travel2gather I/AndroidRuntime: VM exiting with result code 1, cleanup skipped.
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather I/art: WaitForGcToComplete blocked for 5.428ms for cause Background
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather I/art: Background sticky concurrent mark sweep GC freed 164(34KB) AllocSpace objects, 0(0B) LOS objects, 22% free, 666KB/856KB, paused 8.272ms total 38.306ms
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather I/art: Background sticky concurrent mark sweep GC freed 6278(406KB) AllocSpace objects, 0(0B) LOS objects, 13% free, 1497KB/1729KB, paused 5.499ms total 20.437ms

Azure Mobile App: Android .get() causes app to freeze
Because calling .run() as a method instead of passing Runnable to Thread.
Create a Thread:
Runnable mRunnable=new Runnable()
{
// your code here
};
and pass mRunnable object to it:
Thread thread = new Thread(mRunnable);
thread.start();

Related

Interceptor get stuck on it's creation, in POST request

I have a application that need to do a POST request for my server sending a list of item through JSON. But to perform this POST it needs a header configuration with a token auth. When I send the request from the app, on the logcat, it´s possible to see the interceptor instantiation get stuck.
Please, take a look on my code and the logcat debug:
public static Retrofit getServerClient(String token) {
Log.d("DEBUG 1 -> ","getServerClient");
OkHttpClient httpClient;
Gson gson = new GsonBuilder()
.setDateFormat("yyyy-MM-dd'T'HH:mm:ss")
.create();
Retrofit.Builder builder = new Retrofit.Builder()
.baseUrl(SERVER_BASE_URL)
.addConverterFactory(GsonConverterFactory.create(gson));
if (token!=null && !TextUtils.isEmpty(token)) {
Log.d("DEBUG 2 -> ","getServerClient needs add header");
httpClient = getHttpClientWithInterceptor(token);
Log.d("DEBUG 8 -> ","getServerClient with headers");
}else {
httpClient = getOkHttpClient();
}
builder.client(httpClient);
Log.d("DEBUG 9 -> ","Return server client");
return builder.build();
}
private static OkHttpClient getHttpClientWithInterceptor(final String token) {
Log.d("DEBUG 3 -> ","Instantiate interceptor");
Interceptor interceptor = new Interceptor() {
#Override
public Response intercept(Chain chain) {
try {
Log.d("DEBUG 4 -> ","Add headers START");
final Request request = chain.request().newBuilder()
.addHeader("Authorization", "Bearer "+token)
.addHeader("Content-Type", "application/json")
.build();
Log.d("DEBUG 5 -> ","Add headers END");
return chain.proceed(request);
}catch (Exception e){
Log.d("DEBUG 6 -> ","Failure on request build");
e.printStackTrace();
return null;
}
}
};
OkHttpClient.Builder httpClient = new OkHttpClient.Builder();
httpClient.addNetworkInterceptor(interceptor);
Log.d("DEBUG 7 -> ","Return client with interceptor");
return httpClient.build();
}
What is weird in the GET request it works as you can see:
10-30 09:40:16.081 8379-8379/br.com.vegait.android.hotelexperience D/DEBUG 1 ->: getServerClient
10-30 09:40:16.097 8379-8379/br.com.vegait.android.hotelexperience D/DEBUG 2 ->: getServerClient needs add header
10-30 09:40:16.097 8379-8379/br.com.vegait.android.hotelexperience D/DEBUG 3 ->: Instantiate interceptor
10-30 09:40:16.103 8379-8379/br.com.vegait.android.hotelexperience D/DEBUG 7 ->: Return client with interceptor
10-30 09:40:16.104 8379-8379/br.com.vegait.android.hotelexperience D/DEBUG 8 ->: getServerClient with headers
10-30 09:40:16.104 8379-8379/br.com.vegait.android.hotelexperience D/DEBUG 9 ->: Return server client
10-30 09:40:16.193 8379-8425/br.com.vegait.android.hotelexperience D/EGL_emulation: eglMakeCurrent: 0xa39a67a0: ver 2 0 (tinfo 0xa39ef300)
10-30 09:40:16.256 8379-8455/br.com.vegait.android.hotelexperience D/DEBUG 4 ->: Add headers START
10-30 09:40:16.256 8379-8455/br.com.vegait.android.hotelexperience D/DEBUG 5 ->: Add headers END
But on the POST it drops on a loops as the follow log:
10-30 09:45:56.882 12054-12054/br.com.vegait.android.hotelexperience D/DEBUG 1 ->: getServerClient
10-30 09:45:56.897 12054-12054/br.com.vegait.android.hotelexperience D/DEBUG 2 ->: getServerClient needs add header
10-30 09:45:56.897 12054-12054/br.com.vegait.android.hotelexperience D/DEBUG 3 ->: Instantiate interceptor
10-30 09:45:56.901 12054-12054/br.com.vegait.android.hotelexperience D/DEBUG 7 ->: Return client with interceptor
10-30 09:45:56.902 12054-12054/br.com.vegait.android.hotelexperience D/DEBUG 8 ->: getServerClient with headers
10-30 09:45:56.902 12054-12054/br.com.vegait.android.hotelexperience D/DEBUG 9 ->: Return server client
10-30 09:45:56.920 12054-12059/br.com.vegait.android.hotelexperience I/art: Do partial code cache collection, code=30KB, data=26KB
10-30 09:45:56.921 12054-12059/br.com.vegait.android.hotelexperience I/art: After code cache collection, code=29KB, data=26KB
10-30 09:45:56.921 12054-12059/br.com.vegait.android.hotelexperience I/art: Increasing code cache capacity to 128KB
10-30 09:45:56.994 12054-12061/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 7.348ms
10-30 09:45:57.005 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 9.870ms
10-30 09:45:57.412 12054-12065/br.com.vegait.android.hotelexperience I/art: Background sticky concurrent mark sweep GC freed 47547(884KB) AllocSpace objects, 6(120KB) LOS objects, 3% free, 18MB/19MB, paused 5.274ms total 17.663ms
10-30 09:45:57.928 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 5.320ms
10-30 09:45:57.934 12054-12065/br.com.vegait.android.hotelexperience I/art: Background sticky concurrent mark sweep GC freed 175307(3MB) AllocSpace objects, 22(576KB) LOS objects, 16% free, 15MB/18MB, paused 6.735ms total 28.375ms
10-30 09:45:58.380 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 7.855ms
10-30 09:45:58.388 12054-12065/br.com.vegait.android.hotelexperience I/art: Background partial concurrent mark sweep GC freed 149517(2MB) AllocSpace objects, 18(572KB) LOS objects, 18% free, 17MB/21MB, paused 9.750ms total 35.467ms
10-30 09:45:58.493 12054-12061/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 7.182ms
10-30 09:45:58.555 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 7.622ms
10-30 09:45:58.563 12054-12065/br.com.vegait.android.hotelexperience I/art: Background sticky concurrent mark sweep GC freed 180086(3MB) AllocSpace objects, 17(548KB) LOS objects, 14% free, 18MB/21MB, paused 9.906ms total 36.522ms
10-30 09:45:58.569 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 6.073ms
10-30 09:45:58.718 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 8.127ms
10-30 09:45:58.726 12054-12065/br.com.vegait.android.hotelexperience I/art: Background partial concurrent mark sweep GC freed 151954(2MB) AllocSpace objects, 17(604KB) LOS objects, 17% free, 19MB/23MB, paused 9.878ms total 43.588ms
10-30 09:45:58.732 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 5.808ms
10-30 09:45:58.995 12054-12061/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 7.158ms
10-30 09:45:59.277 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 5.132ms
10-30 09:45:59.640 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 6.369ms
10-30 09:45:59.981 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 11.514ms
10-30 09:45:59.994 12054-12065/br.com.vegait.android.hotelexperience I/art: Background sticky concurrent mark sweep GC freed 186259(3MB) AllocSpace objects, 13(572KB) LOS objects, 10% free, 24MB/27MB, paused 14.243ms total 54.366ms
10-30 09:46:00.003 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 9.053ms
10-30 09:46:00.190 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 6.135ms
10-30 09:46:00.397 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 8.317ms
10-30 09:46:00.508 12054-12061/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 6.196ms
10-30 09:46:00.576 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 5.746ms
10-30 09:46:00.763 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 7.054ms
10-30 09:46:00.936 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 6.152ms
10-30 09:46:01.014 12054-12061/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 9.358ms
10-30 09:46:01.207 12054-12065/br.com.vegait.android.hotelexperience I/art: Background sticky concurrent mark sweep GC freed 173843(3MB) AllocSpace objects, 11(572KB) LOS objects, 10% free, 29MB/32MB, paused 3.833ms total 120.445ms
10-30 09:46:01.499 12054-12065/br.com.vegait.android.hotelexperience I/art: Background partial concurrent mark sweep GC freed 176026(3MB) AllocSpace objects, 13(676KB) LOS objects, 11% free, 29MB/33MB, paused 7.948ms total 158.936ms
10-30 09:46:01.513 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 14.086ms
10-30 09:46:01.768 12054-12065/br.com.vegait.android.hotelexperience I/art: Background sticky concurrent mark sweep GC freed 183401(3MB) AllocSpace objects, 10(540KB) LOS objects, 8% free, 30MB/33MB, paused 6.976ms total 55.042ms
10-30 09:46:01.782 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 14.141ms
10-30 09:46:02.091 12054-12061/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 83.993ms
10-30 09:46:02.119 12054-12065/br.com.vegait.android.hotelexperience I/art: Background partial concurrent mark sweep GC freed 146812(2MB) AllocSpace objects, 10(556KB) LOS objects, 11% free, 31MB/35MB, paused 4.086ms total 148.374ms
10-30 09:46:02.132 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 12.503ms
10-30 09:46:02.355 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 10.725ms
10-30 09:46:02.538 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 13.960ms
10-30 09:46:02.551 12054-12065/br.com.vegait.android.hotelexperience I/art: Background sticky concurrent mark sweep GC freed 179103(3MB) AllocSpace objects, 8(448KB) LOS objects, 5% free, 33MB/35MB, paused 16.906ms total 86.519ms
10-30 09:46:02.561 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 9.621ms
10-30 09:46:02.713 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 13.718ms
10-30 09:46:02.730 12054-12065/br.com.vegait.android.hotelexperience I/art: Background partial concurrent mark sweep GC freed 176741(3MB) AllocSpace objects, 13(744KB) LOS objects, 10% free, 33MB/37MB, paused 17.026ms total 105.761ms
10-30 09:46:02.740 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 9.648ms
10-30 09:46:02.919 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 11.148ms
10-30 09:46:03.093 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 15.640ms
10-30 09:46:03.278 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 8.964ms
10-30 09:46:03.466 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 11.234ms
10-30 09:46:03.523 12054-12061/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 6.985ms
10-30 09:46:03.622 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 11.846ms
10-30 09:46:03.749 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 15.134ms
10-30 09:46:03.911 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 9.538ms
10-30 09:46:04.108 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 10.659ms
10-30 09:46:04.264 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 12.444ms
10-30 09:46:04.429 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 16.430ms
10-30 09:46:04.446 12054-12065/br.com.vegait.android.hotelexperience I/art: Background partial concurrent mark sweep GC freed 177011(3MB) AllocSpace objects, 13(860KB) LOS objects, 8% free, 40MB/44MB, paused 20.255ms total 121.688ms
10-30 09:46:04.461 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 15.013ms
10-30 09:46:04.530 12054-12061/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 6.298ms
10-30 09:46:04.670 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 11.041ms
10-30 09:46:04.839 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 12.578ms
10-30 09:46:05.030 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 7.919ms
10-30 09:46:05.242 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 13.381ms
10-30 09:46:05.400 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 14.841ms
10-30 09:46:05.537 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 14.684ms
10-30 09:46:05.735 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 15.828ms
10-30 09:46:05.755 12054-12065/br.com.vegait.android.hotelexperience I/art: Background partial concurrent mark sweep GC freed 191824(3MB) AllocSpace objects, 12(860KB) LOS objects, 8% free, 45MB/49MB, paused 19.760ms total 154.848ms
10-30 09:46:05.770 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 15.253ms
10-30 09:46:05.953 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 14.552ms
10-30 09:46:06.044 12054-12061/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 9.720ms
10-30 09:46:06.138 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 14.542ms
10-30 09:46:06.284 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 15.762ms
10-30 09:46:06.464 12054-12065/br.com.vegait.android.hotelexperience I/art: Background partial concurrent mark sweep GC freed 194534(3MB) AllocSpace objects, 13(968KB) LOS objects, 7% free, 48MB/52MB, paused 3.728ms total 127.593ms
10-30 09:46:06.476 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 11.657ms
10-30 09:46:06.550 12054-12061/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 13.106ms
10-30 09:46:06.664 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 13.684ms
10-30 09:46:06.821 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 14.076ms
10-30 09:46:07.000 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 16.330ms
10-30 09:46:07.016 12054-12065/br.com.vegait.android.hotelexperience I/art: Background partial concurrent mark sweep GC freed 202163(3MB) AllocSpace objects, 11(836KB) LOS objects, 7% free, 51MB/55MB, paused 19.939ms total 136.394ms
10-30 09:46:07.028 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 12.080ms
10-30 09:46:07.227 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 15.434ms
10-30 09:46:07.395 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 17.207ms
10-30 09:46:07.525 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 16.650ms
10-30 09:46:07.713 12054-12065/br.com.vegait.android.hotelexperience I/art: Background partial concurrent mark sweep GC freed 214425(3MB) AllocSpace objects, 12(948KB) LOS objects, 6% free, 53MB/57MB, paused 4.599ms total 122.695ms
10-30 09:46:07.725 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 12.268ms
10-30 09:46:07.928 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 16.880ms
10-30 09:46:08.080 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 20.240ms
10-30 09:46:08.094 12054-12065/br.com.vegait.android.hotelexperience I/art: Background sticky concurrent mark sweep GC freed 160556(2MB) AllocSpace objects, 5(400KB) LOS objects, 3% free, 55MB/57MB, paused 24.451ms total 71.926ms
10-30 09:46:08.113 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 18.642ms
10-30 09:46:08.305 12054-12065/br.com.vegait.android.hotelexperience I/art: Background partial concurrent mark sweep GC freed 212686(3MB) AllocSpace objects, 11(880KB) LOS objects, 6% free, 55MB/59MB, paused 5.110ms total 134.449ms
10-30 09:46:08.319 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 14.065ms
10-30 09:46:08.535 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 15.462ms
10-30 09:46:08.712 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 17.943ms
10-30 09:46:08.907 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 19.325ms
10-30 09:46:08.930 12054-12065/br.com.vegait.android.hotelexperience I/art: Background partial concurrent mark sweep GC freed 219521(3MB) AllocSpace objects, 12(1004KB) LOS objects, 6% free, 58MB/62MB, paused 24.278ms total 157.949ms
10-30 09:46:08.948 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 17.521ms
10-30 09:46:09.067 12054-12061/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 12.066ms
10-30 09:46:09.170 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 18.647ms
10-30 09:46:09.361 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 19.054ms
10-30 09:46:09.583 12054-12061/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 25.753ms
10-30 09:46:09.619 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 18.583ms
10-30 09:46:09.634 12054-12065/br.com.vegait.android.hotelexperience I/art: Background partial concurrent mark sweep GC freed 228847(4MB) AllocSpace objects, 11(924KB) LOS objects, 6% free, 61MB/65MB, paused 22.781ms total 182.292ms
10-30 09:46:09.645 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 11.615ms
10-30 09:46:09.922 12054-12065/br.com.vegait.android.hotelexperience I/art: Background sticky concurrent mark sweep GC freed 209342(3MB) AllocSpace objects, 6(528KB) LOS objects, 4% free, 62MB/65MB, paused 5.230ms total 98.012ms
10-30 09:46:09.943 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 21.805ms
10-30 09:46:10.175 12054-12061/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 114.591ms
10-30 09:46:10.206 12054-12065/br.com.vegait.android.hotelexperience I/art: Background partial concurrent mark sweep GC freed 157725(2MB) AllocSpace objects, 10(876KB) LOS objects, 6% free, 62MB/66MB, paused 4.308ms total 153.014ms
10-30 09:46:10.223 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 17.394ms
10-30 09:46:10.460 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 18.833ms
10-30 09:46:10.579 12054-12061/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 16.845ms
10-30 09:46:10.739 12054-12065/br.com.vegait.android.hotelexperience I/art: Background partial concurrent mark sweep GC freed 278135(4MB) AllocSpace objects, 11(968KB) LOS objects, 5% free, 64MB/68MB, paused 4.272ms total 179.332ms
10-30 09:46:10.752 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 12.981ms
And keep like this until crash. What I am doing wrong?
it´s me again.
Just to leave a feedback about my issue. I found the problem.
The object I was sending on request was different from the one mapped to be send.
Idk why it stuck de interceptor, but when I just change the object it worked like a charm. I will leave this here for someone else that might have the same problem.
Thank you any way.
First of all you have to add crash log. But anyway log that you provide means that you're using memory, then it's being freed by the GC But seems like you do to much work and GC can't provide tp you enought memory and your app shot down with OutOfMemory exception. So first of all in this case you have to use Singleton pattern to avoid creation all of this Objects like (HttpClient, Gson, Interceptor ect..)So let's pretend this class entitled HttpClient. Then you need something like NetManager that will be a singleton..
public class NetManager {
private static NetManager instance;
private HttpClient httpClient;
private NetManager() {
httpClient = new HttpClient();
}
public static NetManager() {
if (instance == null) {
instance = new NetManager();
}
return instance;
}
public HttpClient getHttpClient() {
return httpClient;
}
}
And user your httpClient through this manager.
But in general it's a very very VERY bad to make network requests in a loop.

App crash when I click on device back button android

when I click on back button my application crashes
This happen in all my pages I have 3 activity and other are fragments in my application I am not getting who is creating this problem
this the full logcat I am not getting any error in my connection or any where but when I click device back button app crashes
09-13 15:00:32.366 3843-3843/com.example.user.soulsystem I/art: Not late-enabling -Xcheck:jni (already on)
09-13 15:00:32.492 3843-3843/com.example.user.soulsystem W/System: ClassLoader referenced unknown path: /data/app/com.example.user.soulsystem-1/lib/x86
09-13 15:00:47.049 3843-3843/com.example.user.soulsystem W/System: ClassLoader referenced unknown path: /data/app/com.example.user.soulsystem-1/lib/x86
09-13 15:00:47.069 3843-3843/com.example.user.soulsystem D/FirebaseApp: com.google.firebase.auth.FirebaseAuth is not linked. Skipping initialization.
09-13 15:00:47.078 3843-3843/com.example.user.soulsystem W/InstanceID/Rpc: Found 10008
09-13 15:00:47.081 3843-3843/com.example.user.soulsystem D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
09-13 15:00:47.107 3843-3843/com.example.user.soulsystem I/FA: App measurement is starting up, version: 9452
09-13 15:00:47.108 3843-3843/com.example.user.soulsystem I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
09-13 15:00:47.151 3843-3843/com.example.user.soulsystem I/FirebaseInitProvider: FirebaseApp initialization successful
09-13 15:00:47.232 3843-3843/com.example.user.soulsystem W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
09-13 15:00:47.984 3843-3849/com.example.user.soulsystem W/art: Suspending all threads took: 30.062ms
09-13 15:00:47.987 3843-3843/com.example.user.soulsystem W/art: Verification of android.view.View android.support.v7.app.AppCompatViewInflater.createView(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet, boolean, boolean, boolean, boolean) took 495.933ms
09-13 15:00:47.988 3843-3853/com.example.user.soulsystem I/art: Background partial concurrent mark sweep GC freed 1579(368KB) AllocSpace objects, 4(80KB) LOS objects, 39% free, 2MB/3MB, paused 440us total 484.103ms
09-13 15:00:48.118 3843-4245/com.example.user.soulsystem D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true [
09-13 15:00:48.142 3843: 3843 D/ HostConnection::get() New Host Connection established 0xab1d6140, tid 3843
09-13 15:00:48.188 3843: 4245 D/ HostConnection::get() New Host Connection established 0xaec47600, tid 4245
09-13 15:00:48.191 3843-4245/com.example.user.soulsystem I/OpenGLRenderer: Initialized EGL, version 1.4
09-13 15:00:53.820 3843-3849/com.example.user.soulsystem W/art: Suspending all threads took: 87.047ms
09-13 15:00:58.115 3843-4232/com.example.user.soulsystem I/FA: Tag Manager is not found and thus will not be used
09-13 15:02:23.664 3843-5617/com.example.user.soulsystem D/Volley: [221] BasicNetwork.logSlowRequests: HTTP response for request=<[ ] http://192.168.1.10/soulsystem/loginall.php 0x676929bb NORMAL 1> [lifetime=3118], [size=189], [rc=200], [retryCount=1]
09-13 15:02:23.827 3843-3843/com.example.user.soulsystem D/ClientRegistration: Login Response: {"error":false,"error_msg":"Finding Consultancy","uid":"57d245518c9643.05931211","user":{"name":"Ram Waghmare","email":"ram#gmail.com","created_at":"2016-09-09 10:44:57","updated_at":null}}
09-13 15:02:23.832 3843-4245/com.example.user.soulsystem E/Surface: getSlotFromBufferLocked: unknown buffer: 0xa31a2540
09-13 15:02:23.840 3843-3843/com.example.user.soulsystem D/Soulsystem: IN try catch
09-13 15:02:24.073 3843-3843/com.example.user.soulsystem D/SessionManager: User login session modified!
09-13 15:02:24.625 3843-3843/com.example.user.soulsystem D/SQLiteHandler: Database tables created
09-13 15:02:24.994 3843-3843/com.example.user.soulsystem D/SQLiteHandler: New user inserted into sqlite: 1
09-13 15:02:25.028 3843-3843/com.example.user.soulsystem D/Volley: [1] Request.finish: 4483 ms: [ ] http://192.168.1.10/soulsystem/loginall.php 0x676929bb NORMAL 1
09-13 15:02:25.028 3843-3843/com.example.user.soulsystem I/Choreographer: Skipped 71 frames! The application may be doing too much work on its main thread.
09-13 15:02:25.071 3843-3843/com.example.user.soulsystem I/AppCompatViewInflater: app:theme is now deprecated. Please move to using android:theme instead.
09-13 15:02:25.215 3843-3843/com.example.user.soulsystem D/SQLiteHandler: Fetching user from Sqlite: {email=ram#gmail.com, name=Ram Waghmare, created_at=2016-09-09 10:44:57, uid=57d245518c9643.05931211}
09-13 15:02:25.215 3843-3843/com.example.user.soulsystem D/Soulsystem: Ram Waghmare
09-13 15:02:25.215 3843-3843/com.example.user.soulsystem D/Soulsystem: ram#gmail.com
09-13 15:02:25.268 3843-3843/com.example.user.soulsystem W/ActionBarDrawerToggle: DrawerToggle may not show up because NavigationIcon is not visible. You may need to call actionbar.setDisplayHomeAsUpEnabled(true);
09-13 15:02:25.489 3843-4245/com.example.user.soulsystem E/Surface: getSlotFromBufferLocked: unknown buffer: 0xa31a2460
09-13 15:03:18.027 3843-3849/com.example.user.soulsystem W/art: Suspending all threads took: 6.244ms
09-13 15:03:34.556 3843-3849/com.example.user.soulsystem W/art: Suspending all threads took: 7.122ms
09-13 15:05:58.974 3843-3843/com.example.user.soulsystem D/NavigationMenu: In profile Image view
[ 09-13 15:06:13.139 1604: 1882 D/ ]
HostConnection::get() New Host Connection established 0x9ad14230, tid 1882
09-13 15:06:13.360 3843-3843/com.example.user.soulsystem D/FirebaseApp: Notifying background state change listeners.
09-13 15:06:13.366 3843-4245/com.example.user.soulsystem E/Surface: getSlotFromBufferLocked: unknown buffer: 0xa31a2770
09-13 15:13:27.679 15191-15191/com.example.user.soulsystem W/System: ClassLoader referenced unknown path: /data/app/com.example.user.soulsystem-1/lib/x86
09-13 15:13:27.716 15191-15191/com.example.user.soulsystem D/FirebaseApp: com.google.firebase.auth.FirebaseAuth is not linked. Skipping initialization.
09-13 15:13:27.733 15191-15191/com.example.user.soulsystem D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
09-13 15:13:27.766 15191-15191/com.example.user.soulsystem I/FA: App measurement is starting up, version: 9452
09-13 15:13:27.766 15191-15191/com.example.user.soulsystem I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
09-13 15:13:27.795 15191-15191/com.example.user.soulsystem I/FirebaseInitProvider: FirebaseApp initialization successful
09-13 15:13:27.857 15191-15191/com.example.user.soulsystem W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
09-13 15:13:27.937 15191-15191/com.example.user.soulsystem I/AppCompatViewInflater: app:theme is now deprecated. Please move to using android:theme instead.
09-13 15:13:28.061 15191-15191/com.example.user.soulsystem D/SQLiteHandler: Fetching user from Sqlite: {email=ram#gmail.com, name=Ram Waghmare, created_at=2016-09-09 10:44:57, uid=57d245518c9643.05931211}
09-13 15:13:28.061 15191-15191/com.example.user.soulsystem D/Soulsystem: Ram Waghmare
09-13 15:13:28.061 15191-15191/com.example.user.soulsystem D/Soulsystem: ram#gmail.com
09-13 15:13:28.065 15191-15191/com.example.user.soulsystem W/ActionBarDrawerToggle: DrawerToggle may not show up because NavigationIcon is not visible. You may need to call actionbar.setDisplayHomeAsUpEnabled(true);
09-13 15:13:28.071 15191-15273/com.example.user.soulsystem D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
[ 09-13 15:13:28.075 15191:15191 D/ ]
HostConnection::get() New Host Connection established 0xaaace1a0, tid 15191
[ 09-13 15:13:28.107 15191:15273 D/ ]
HostConnection::get() New Host Connection established 0xaaace5c0, tid 15273
09-13 15:13:28.111 15191-15273/com.example.user.soulsystem I/OpenGLRenderer: Initialized EGL, version 1.4
09-13 15:13:31.233 15191-15191/com.example.user.soulsystem D/FirebaseApp: Notifying background state change listeners.
09-13 15:13:31.243 15191-15273/com.example.user.soulsystem E/Surface: getSlotFromBufferLocked: unknown buffer: 0xab1f0b70
09-13 15:13:32.265 15191-15270/com.example.user.soulsystem I/FA: Tag Manager is not found and thus will not be used
09-13 15:13:34.089 15191-15191/com.example.user.soulsystem D/FirebaseApp: Notifying background state change listeners.
09-13 15:13:34.188 15191-15191/com.example.user.soulsystem I/AppCompatViewInflater: app:theme is now deprecated. Please move to using android:theme instead.
09-13 15:13:34.212 15191-15191/com.example.user.soulsystem D/SQLiteHandler: Fetching user from Sqlite: {email=ram#gmail.com, name=Ram Waghmare, created_at=2016-09-09 10:44:57, uid=57d245518c9643.05931211}
09-13 15:13:34.212 15191-15191/com.example.user.soulsystem D/Soulsystem: Ram Waghmare
09-13 15:13:34.212 15191-15191/com.example.user.soulsystem D/Soulsystem: ram#gmail.com
09-13 15:13:34.213 15191-15191/com.example.user.soulsystem W/ActionBarDrawerToggle: DrawerToggle may not show up because NavigationIcon is not visible. You may need to call actionbar.setDisplayHomeAsUpEnabled(true);
09-13 15:13:38.875 15191-15191/com.example.user.soulsystem D/FirebaseApp: Notifying background state change listeners.
09-13 15:13:38.879 15191-15273/com.example.user.soulsystem E/Surface: getSlotFromBufferLocked: unknown buffer: 0xab1f0be0
09-13 15:13:41.251 15191-15191/com.example.user.soulsystem D/FirebaseApp: Notifying background state change listeners.
09-13 15:13:41.327 15191-15191/com.example.user.soulsystem I/AppCompatViewInflater: app:theme is now deprecated. Please move to using android:theme instead.
09-13 15:13:41.393 15191-15191/com.example.user.soulsystem D/SQLiteHandler: Fetching user from Sqlite: {email=ram#gmail.com, name=Ram Waghmare, created_at=2016-09-09 10:44:57, uid=57d245518c9643.05931211}
09-13 15:13:41.393 15191-15191/com.example.user.soulsystem D/Soulsystem: Ram Waghmare
09-13 15:13:41.393 15191-15191/com.example.user.soulsystem D/Soulsystem: ram#gmail.com
09-13 15:13:41.394 15191-15191/com.example.user.soulsystem W/ActionBarDrawerToggle: DrawerToggle may not show up because NavigationIcon is not visible. You may need to call actionbar.setDisplayHomeAsUpEnabled(true);
09-13 15:18:45.102 15191-15197/com.example.user.soulsystem W/art: Suspending all threads took: 7.875ms
09-13 15:19:29.694 15191-15197/com.example.user.soulsystem W/art: Suspending all threads took: 6.903ms
09-13 15:19:37.196 15191-15197/com.example.user.soulsystem W/art: Suspending all threads took: 6.748ms
09-13 15:20:12.361 21039-21039/com.example.user.soulsystem W/System: ClassLoader referenced unknown path: /data/app/com.example.user.soulsystem-1/lib/x86
09-13 15:20:15.446 21039-21039/com.example.user.soulsystem W/System: ClassLoader referenced unknown path: /data/app/com.example.user.soulsystem-1/lib/x86
09-13 15:20:15.463 21039-21039/com.example.user.soulsystem D/FirebaseApp: com.google.firebase.auth.FirebaseAuth is not linked. Skipping initialization.
09-13 15:20:15.477 21039-21039/com.example.user.soulsystem D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
09-13 15:20:15.517 21039-21039/com.example.user.soulsystem I/FA: App measurement is starting up, version: 9452
09-13 15:20:15.517 21039-21039/com.example.user.soulsystem I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
09-13 15:20:15.541 21039-21039/com.example.user.soulsystem I/FirebaseInitProvider: FirebaseApp initialization successful
09-13 15:20:15.606 21039-21039/com.example.user.soulsystem W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
09-13 15:20:15.777 21039-21049/com.example.user.soulsystem I/art: Background partial concurrent mark sweep GC freed 6738(1363KB) AllocSpace objects, 49(820KB) LOS objects, 41% free, 1462KB/2MB, paused 301us total 152.112ms
09-13 15:20:15.826 21039-21039/com.example.user.soulsystem I/AppCompatViewInflater: app:theme is now deprecated. Please move to using android:theme instead.
09-13 15:20:15.955 21039-21039/com.example.user.soulsystem D/SQLiteHandler: Fetching user from Sqlite: {email=ram#gmail.com, name=Ram Waghmare, created_at=2016-09-09 10:44:57, uid=57d245518c9643.05931211}
09-13 15:20:15.955 21039-21039/com.example.user.soulsystem D/Soulsystem: Ram Waghmare
09-13 15:20:15.955 21039-21039/com.example.user.soulsystem D/Soulsystem: ram#gmail.com
09-13 15:20:15.966 21039-21122/com.example.user.soulsystem D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
[ 09-13 15:20:15.972 21039:21039 D/ ]
HostConnection::get() New Host Connection established 0xaaacde40, tid 21039
[ 09-13 15:20:16.013 21039:21122 D/ ]
HostConnection::get() New Host Connection established 0xaec47600, tid 21122
09-13 15:20:16.016 21039-21122/com.example.user.soulsystem I/OpenGLRenderer: Initialized EGL, version 1.4
09-13 15:20:17.984 21039-21045/com.example.user.soulsystem W/art: Suspending all threads took: 7.043ms
09-13 15:20:42.993 21039-21039/com.example.user.soulsystem I/ListPopupWindow: Could not find method setEpicenterBounds(Rect) on PopupWindow. Oh well.
09-13 15:20:43.035 21039-21039/com.example.user.soulsystem W/art: Before Android 4.1, method int android.support.v7.widget.ListViewCompat.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView
09-13 15:20:43.941 21039-21122/com.example.user.soulsystem E/Surface: getSlotFromBufferLocked: unknown buffer: 0xa2904bc0
09-13 15:20:43.944 21039-21122/com.example.user.soulsystem D/OpenGLRenderer: endAllStagingAnimators on 0xa261c600 (MenuPopupWindow$MenuDropDownListView) with handle 0xaec52fa0
09-13 15:20:47.274 21039-21122/com.example.user.soulsystem E/Surface: getSlotFromBufferLocked: unknown buffer: 0xa2904bc0
09-13 15:20:47.278 21039-21122/com.example.user.soulsystem D/OpenGLRenderer: endAllStagingAnimators on 0xa14a2d80 (MenuPopupWindow$MenuDropDownListView) with handle 0xab33f630
09-13 15:21:05.931 21039-21112/com.example.user.soulsystem W/System: ClassLoader referenced unknown path: /data/data/com.example.user.soulsystem/lib
09-13 15:21:05.992 21039-21039/com.example.user.soulsystem I/AppCompatViewInflater: app:theme is now deprecated. Please move to using android:theme instead.
09-13 15:21:05.999 21039-21039/com.example.user.soulsystem D/SQLiteHandler: Fetching user from Sqlite: {email=ram#gmail.com, name=Ram Waghmare, created_at=2016-09-09 10:44:57, uid=57d245518c9643.05931211}
09-13 15:21:05.999 21039-21039/com.example.user.soulsystem D/Soulsystem: Ram Waghmare
09-13 15:21:05.999 21039-21039/com.example.user.soulsystem D/Soulsystem: ram#gmail.com
09-13 15:21:06.009 21039-21122/com.example.user.soulsystem E/Surface: getSlotFromBufferLocked: unknown buffer: 0xa2904b50
09-13 15:21:06.150 21039-21122/com.example.user.soulsystem V/RenderScript: 0xa1e12000 Launching thread(s), CPUs 2
09-13 15:21:07.974 21039-21122/com.example.user.soulsystem E/Surface: getSlotFromBufferLocked: unknown buffer: 0xa2904ed0
09-13 15:21:10.712 21039-21122/com.example.user.soulsystem E/Surface: getSlotFromBufferLocked: unknown buffer: 0xa2904f40
09-13 15:21:17.190 21039-21122/com.example.user.soulsystem E/Surface: getSlotFromBufferLocked: unknown buffer: 0xa29035e0
09-13 15:21:27.843 21039-21122/com.example.user.soulsystem E/Surface: getSlotFromBufferLocked: unknown buffer: 0xa2903570
09-13 15:23:27.349 21039-21045/com.example.user.soulsystem W/art: Suspending all threads took: 11.127ms
09-13 15:25:31.502 25691-25691/com.example.user.soulsystem W/System: ClassLoader referenced unknown path: /data/app/com.example.user.soulsystem-1/lib/x86
09-13 15:25:35.414 25691-25691/com.example.user.soulsystem W/System: ClassLoader referenced unknown path: /data/app/com.example.user.soulsystem-1/lib/x86
09-13 15:25:35.430 25691-25691/com.example.user.soulsystem D/FirebaseApp: com.google.firebase.auth.FirebaseAuth is not linked. Skipping initialization.
09-13 15:25:35.463 25691-25691/com.example.user.soulsystem D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
09-13 15:25:35.488 25691-25691/com.example.user.soulsystem I/FA: App measurement is starting up, version: 9452
09-13 15:25:35.488 25691-25691/com.example.user.soulsystem I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
09-13 15:25:35.513 25691-25691/com.example.user.soulsystem I/FirebaseInitProvider: FirebaseApp initialization successful
09-13 15:25:35.605 25691-25691/com.example.user.soulsystem W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
09-13 15:25:35.694 25691-25691/com.example.user.soulsystem I/AppCompatViewInflater: app:theme is now deprecated. Please move to using android:theme instead.
09-13 15:25:35.825 25691-25691/com.example.user.soulsystem D/SQLiteHandler: Fetching user from Sqlite: {email=ram#gmail.com, name=Ram Waghmare, created_at=2016-09-09 10:44:57, uid=57d245518c9643.05931211}
09-13 15:25:35.825 25691-25691/com.example.user.soulsystem D/Soulsystem: Ram Waghmare
09-13 15:25:35.825 25691-25691/com.example.user.soulsystem D/Soulsystem: ram#gmail.com
09-13 15:25:35.834 25691-25786/com.example.user.soulsystem D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
[ 09-13 15:25:35.840 25691:25691 D/ ]
HostConnection::get() New Host Connection established 0xb2f28600, tid 25691
[ 09-13 15:25:35.874 25691:25786 D/ ]
HostConnection::get() New Host Connection established 0xaec47600, tid 25786
09-13 15:25:35.877 25691-25786/com.example.user.soulsystem I/OpenGLRenderer: Initialized EGL, version 1.4
09-13 15:26:48.624 25691-25697/com.example.user.soulsystem W/art: Suspending all threads took: 7.614ms
Did you call actionbar.setDisplayHomeAsUpEnabled(true) in your code?
Please try this
#Override
public void onBackPressed() {
super.onBackPressed();
finish();
}
there is another good reference is here

Unfortunately Android App stopped

I/art: Background sticky concurrent mark sweep GC freed 2534(750KB) AllocSpace objects, 2(32KB) LOS objects, 16% free, 1439KB/1723KB, paused 1.210ms total 209.320ms
W/art: Suspending all threads took: 48.938ms
W/MainActivity: onResume
W/art: Suspending all threads took: 33.435ms
I/art: Background partial concurrent mark sweep GC freed 1004(119KB) AllocSpace objects, 0(0B) LOS objects, 41% free, 1448KB/2MB, paused 33.859ms total 111.039ms
D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
[ 09-02 18:38:14.477 2286: 2286 D/ ]
HostConnection::get() New Host Connection established 0x7f5d1785eac0, tid 2286
D/Atlas: Validating map...
E/AndroidRuntime: FATAL EXCEPTION: IntentService[]
Process: com.example.user.gcmexample, PID: 2286
java.lang.IncompatibleClassChangeError: The method 'java.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDir(android.content.Context)' was expected to be of type virtual but instead was found to be of type direct (declaration of 'java.lang.reflect.ArtMethod' appears in /system/framework/core-libart.jar)
at com.google.android.gms.iid.zzd.zzdL(Unknown Source)
at com.google.android.gms.iid.zzd.<init>(Unknown Source)
at com.google.android.gms.iid.zzd.<init>(Unknown Source)
at com.google.android.gms.iid.InstanceID.zza(Unknown Source)
at com.google.android.gms.iid.InstanceID.getInstance(Unknown Source)
at com.example.user.gcmexample.GCMRegistrationIntentService.registerGCM(GCMRegistrationIntentService.java:31)
at com.example.user.gcmexample.GCMRegistrationIntentService.onHandleIntent(GCMRegistrationIntentService.java:24)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.os.HandlerThread.run(HandlerThread.java:61)
I/OpenGLRenderer: Initialized EGL, version 1.4
D/OpenGLRenderer: Enabling debug mode 0
W/EGL_emulation: eglSurfaceAttrib not implemented
W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x7f5d1a94d200, error=EGL_SUCCESS
W/MainActivity: onPause
I/Process: Sending signal. PID: 2286 SIG: 9
Application terminated.
I am working on google cloud messaging with Android. When I am running program, my app not launching and giving error message
Unfortunately "Application name " has stopped.

android emulator keeps crashing when i attempt to change tab

i have no errors in my application but when i switch tabs it freezes and closes the application in the emulator and i'm new to the android studio and android development in general. i do not have a clue what to do next.
here is my logcat
03-23 11:56:05.749 2417-2417/com.example.hp_user.shoutfinal28 I/art: Not late-enabling -Xcheck:jni (already on)
03-23 11:56:05.994 2417-2417/com.example.hp_user.shoutfinal28 W/System: ClassLoader referenced unknown path: /data/app/com.example.hp_user.shoutfinal28-1/lib/x86
03-23 11:56:06.021 2417-2417/com.example.hp_user.shoutfinal28 I/GMPM: App measurement is starting up, version: 8487
03-23 11:56:06.021 2417-2417/com.example.hp_user.shoutfinal28 I/GMPM: To enable debug logging run: adb shell setprop log.tag.GMPM VERBOSE
03-23 11:56:06.032 2417-2417/com.example.hp_user.shoutfinal28 E/GMPM: GoogleService failed to initialize, status: 10, Missing an expected resource: 'R.string.google_app_id' for initializing Google services. Possible causes are missing google-services.json or com.google.gms.google-services gradle plugin.
03-23 11:56:06.032 2417-2417/com.example.hp_user.shoutfinal28 E/GMPM: Scheduler not set. Not logging error/warn.
03-23 11:56:06.209 2417-2433/com.example.hp_user.shoutfinal28 E/GMPM: Uploading is not possible. App measurement disabled
03-23 11:56:06.741 2417-2435/com.example.hp_user.shoutfinal28 D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
03-23 11:56:07.233 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 42.830ms
03-23 11:56:07.507 2417-2435/com.example.hp_user.shoutfinal28 I/OpenGLRenderer: Initialized EGL, version 1.4
03-23 11:56:07.670 2417-2435/com.example.hp_user.shoutfinal28 W/EGL_emulation: eglSurfaceAttrib not implemented
03-23 11:56:07.670 2417-2435/com.example.hp_user.shoutfinal28 W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xad92f000, error=EGL_SUCCESS
03-23 11:56:07.874 2417-2417/com.example.hp_user.shoutfinal28 I/Choreographer: Skipped 46 frames! The application may be doing too much work on its main thread.
03-23 11:56:09.040 2417-2417/com.example.hp_user.shoutfinal28 I/Choreographer: Skipped 67 frames! The application may be doing too much work on its main thread.
03-23 11:56:14.016 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 10.772ms
03-23 11:56:16.753 2417-2433/com.example.hp_user.shoutfinal28 I/GMPM: Tag Manager is not found and thus will not be used
03-23 11:56:16.910 2417-2422/com.example.hp_user.shoutfinal28 I/art: Thread[2,tid=2422,WaitingInMainSignalCatcherLoop,Thread*=0xad90ed00,peer=0x12c7a0a0,"Signal Catcher"]: reacting to signal 3
03-23 11:56:17.048 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 46.962ms
03-23 11:56:17.211 2417-2422/com.example.hp_user.shoutfinal28 I/art: Wrote stack traces to '/data/anr/traces.txt'
03-23 11:56:22.415 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 6.324ms
03-23 11:56:33.717 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 12.067ms
03-23 11:56:39.211 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 17.079ms
03-23 11:57:13.188 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 12.698ms
03-23 11:57:15.690 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 5.155ms
03-23 11:57:19.158 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 11.179ms
03-23 11:57:21.138 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 10.996ms
03-23 11:57:40.748 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 11.140ms
03-23 11:57:46.163 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 6.413ms
03-23 11:57:57.981 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 8.603ms
03-23 11:58:00.909 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 12.863ms
03-23 11:58:04.638 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 21.404ms
03-23 11:58:18.369 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 21.777ms
03-23 11:58:24.334 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 31.972ms
03-23 11:58:24.769 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 12.558ms
03-23 11:58:25.399 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 21.461ms
03-23 11:58:35.213 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 5.951ms
03-23 11:58:38.694 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 7.319ms
03-23 11:58:51.712 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 10.430ms
03-23 11:59:08.130 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 11.958ms
03-23 11:59:16.520 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 12.715ms
03-23 11:59:28.920 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 31.685ms
03-23 11:59:29.423 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 15.909ms
03-23 11:59:30.402 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 5.648ms
03-23 11:59:30.923 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 16.189ms
03-23 11:59:57.004 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 6.171ms
03-23 12:00:04.514 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 5.080ms
03-23 12:00:05.500 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 21.063ms
03-23 12:00:09.465 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 5.965ms
03-23 12:00:19.918 2417-2423/com.example.hp_user.shoutfinal28 W/art:
Suspending all threads took: 9.964ms
03-23 12:00:21.427 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 17.293ms
03-23 12:00:30.382 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 13.516ms
03-23 12:01:20.767 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 7.766ms
03-23 12:01:32.806 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 26.784ms
03-23 12:01:33.904 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 36.950ms
03-23 12:02:18.777 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 6.365ms
03-23 12:02:39.284 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 14.412ms
03-23 12:03:00.297 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 25.732ms
03-23 12:03:01.280 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 8.056ms
03-23 12:03:12.798 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 5.714ms
03-23 12:03:17.801 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 8.841ms
03-23 12:03:23.760 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 7.779ms
03-23 12:03:44.725 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 13.453ms
03-23 12:03:52.812 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 66.320ms
03-23 12:03:57.738 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 5.062ms
03-23 12:04:12.258 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 5.525ms
03-23 12:04:14.760 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 7.565ms
03-23 12:04:16.782 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 19.185ms
03-23 12:04:23.730 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 7.169ms
03-23 12:04:31.254 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 11.048ms
03-23 12:04:38.743 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 10.787ms
03-23 12:05:00.175 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 106.406ms
03-23 12:05:02.590 2417-2435/com.example.hp_user.shoutfinal28 W/EGL_emulation: eglSurfaceAttrib not implemented
03-23 12:05:02.590 2417-2435/com.example.hp_user.shoutfinal28 W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa21045c0, error=EGL_SUCCESS
03-23 12:05:04.016 2417-2435/com.example.hp_user.shoutfinal28 E/Surface: getSlotFromBufferLocked: unknown buffer: 0xabfe4d10
03-23 12:05:06.035 2417-2427/com.example.hp_user.shoutfinal28 I/art: Background sticky concurrent mark sweep GC freed 15606(1053KB) AllocSpace objects, 6(120KB) LOS objects, 37% free, 2MB/3MB, paused 19.193ms total 246.150ms
03-23 12:05:06.076 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 16.765ms
03-23 12:05:06.509 2417-2427/com.example.hp_user.shoutfinal28 I/art: Background partial concurrent mark sweep GC freed 1885(1770KB) AllocSpace objects, 1(24KB) LOS objects, 39% free, 3MB/6MB, paused 24.099ms total 241.046ms
03-23 12:05:06.553 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 5.531ms
03-23 12:05:06.767 2417-2427/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 20.589ms
03-23 12:05:06.918 2417-2427/com.example.hp_user.shoutfinal28 I/art: Background sticky concurrent mark sweep GC freed 1034(2MB) AllocSpace objects, 0(0B) LOS objects, 10% free, 5MB/6MB, paused 129.285ms total 303.506ms
03-23 12:05:06.929 2417-2427/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 9.437ms
03-23 12:05:07.075 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 39.477ms
03-23 12:05:07.086 2417-2427/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 11.998ms
03-23 12:05:07.187 2417-2427/com.example.hp_user.shoutfinal28 I/art: Background sticky concurrent mark sweep GC freed 464(1401KB) AllocSpace objects, 0(0B) LOS objects, 10% free, 5MB/6MB, paused 65.404ms total 239.195ms
03-23 12:05:07.220 2417-2427/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 31.710ms
03-23 12:05:07.510 2417-2427/com.example.hp_user.shoutfinal28 I/art: Background partial concurrent mark sweep GC freed 517(1538KB) AllocSpace objects, 0(0B) LOS objects, 36% free, 7MB/11MB, paused 29.730ms total 245.372ms
03-23 12:05:07.865 2417-2427/com.example.hp_user.shoutfinal28 I/art: Background sticky concurrent mark sweep GC freed 810(3MB) AllocSpace objects, 0(0B) LOS objects, 19% free, 8MB/11MB, paused 60.048ms total 195.013ms
03-23 12:05:08.085 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 7.930ms
03-23 12:05:08.097 2417-2427/com.example.hp_user.shoutfinal28 I/art: Background sticky concurrent mark sweep GC freed 558(2MB) AllocSpace objects, 0(0B) LOS objects, 2% free, 10MB/11MB, paused 57.680ms total 199.141ms
03-23 12:05:08.372 2417-2427/com.example.hp_user.shoutfinal28 I/art: Background sticky concurrent mark sweep GC freed 330(1634KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 11MB/11MB, paused 45.586ms total 260.298ms
03-23 12:05:08.593 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 7.991ms
03-23 12:05:08.599 2417-2427/com.example.hp_user.shoutfinal28 I/art: Background partial concurrent mark sweep GC freed 474(2MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 12MB/16MB, paused 52.037ms total 213.333ms
03-23 12:05:08.871 2417-2427/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 13.742ms
03-23 12:05:08.973 2417-2427/com.example.hp_user.shoutfinal28 I/art: Background sticky concurrent mark sweep GC freed 1030(5MB) AllocSpace objects, 0(0B) LOS objects, 8% free, 15MB/16MB, paused 136.535ms total 320.111ms
03-23 12:05:09.127 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 61.076ms
03-23 12:05:09.133 2417-2427/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 7.412ms
03-23 12:05:09.227 2417-2427/com.example.hp_user.shoutfinal28 I/art: Background sticky concurrent mark sweep GC freed 366(1835KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 17MB/17MB, paused 69.814ms total 225.055ms
03-23 12:05:09.546 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 19.416ms
03-23 12:05:09.556 2417-2427/com.example.hp_user.shoutfinal28 I/art: Background partial concurrent mark sweep GC freed 639(2MB) AllocSpace objects, 29(464KB) LOS objects, 17% free, 18MB/22MB, paused 70.188ms total 317.219ms
03-23 12:05:09.576 2417-2427/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 19.102ms
03-23 12:05:09.976 2417-2427/com.example.hp_user.shoutfinal28 I/art: Background sticky concurrent mark sweep GC freed 555(2MB) AllocSpace objects, 183(2MB) LOS objects, 10% free, 20MB/22MB, paused 79.907ms total 322.037ms
03-23 12:05:09.989 2417-2427/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 11.923ms
03-23 12:05:10.486 2417-2427/com.example.hp_user.shoutfinal28 I/art: Background partial concurrent mark sweep GC freed 427(1679KB) AllocSpace objects, 140(2MB) LOS objects, 14% free, 23MB/27MB, paused 72.435ms total 402.265ms
03-23 12:05:10.875 2417-2427/com.example.hp_user.shoutfinal28 I/art: Background sticky concurrent mark sweep GC freed 501(2005KB) AllocSpace objects, 165(2MB) LOS objects, 7% free, 25MB/27MB, paused 81.908ms total 324.161ms
03-23 12:05:10.884 2417-2427/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 7.802ms
03-23 12:05:11.172 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 165.365ms
03-23 12:05:11.288 2417-2427/com.example.hp_user.shoutfinal28 I/art: Background partial concurrent mark sweep GC freed 273(1063KB) AllocSpace objects, 89(1424KB) LOS objects, 12% free, 27MB/31MB, paused 75.815ms total 355.692ms
03-23 12:05:11.747 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 230.989ms
03-23 12:05:11.778 2417-2427/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 5.070ms
03-23 12:05:11.905 2417-2427/com.example.hp_user.shoutfinal28 I/art: Background sticky concurrent mark sweep GC freed 447(1787KB) AllocSpace objects, 147(2MB) LOS objects, 12% free, 27MB/31MB, paused 121.279ms total 547.928ms
03-23 12:05:11.913 2417-2427/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 7.013ms
03-23 12:05:12.200 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 144.899ms
03-23 12:05:12.218 2417-2427/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 7.041ms
03-23 12:05:12.394 2417-2427/com.example.hp_user.shoutfinal28 I/art: Clamp target GC heap from 32MB to 32MB
03-23 12:05:12.394 2417-2427/com.example.hp_user.shoutfinal28 I/art: Background partial concurrent mark sweep GC freed 303(1183KB) AllocSpace objects, 98(1952KB) LOS objects, 10% free, 28MB/32MB, paused 167.749ms total 431.021ms
03-23 12:05:12.555 2417-2417/com.example.hp_user.shoutfinal28 I/art: Waiting for a blocking GC Alloc
03-23 12:05:12.629 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 147.707ms
03-23 12:05:12.730 2417-2427/com.example.hp_user.shoutfinal28 I/art: Background sticky concurrent mark sweep GC freed 242(978KB) AllocSpace objects, 80(1600KB) LOS objects, 7% free, 29MB/32MB, paused 86.419ms total 299.323ms
03-23 12:05:12.732 2417-2417/com.example.hp_user.shoutfinal28 I/art: WaitForGcToComplete blocked for 177.147ms for cause Alloc
03-23 12:05:12.733 2417-2417/com.example.hp_user.shoutfinal28 I/art: Starting a blocking GC Alloc
03-23 12:05:12.769 2417-2417/com.example.hp_user.shoutfinal28 I/art: Starting a blocking GC Alloc
03-23 12:05:12.769 2417-2417/com.example.hp_user.shoutfinal28 I/art: Starting a blocking GC Alloc
03-23 12:05:13.069 2417-2417/com.example.hp_user.shoutfinal28 I/art: Clamp target GC heap from 34MB to 32MB
03-23 12:05:13.069 2417-2417/com.example.hp_user.shoutfinal28 I/art: Alloc partial concurrent mark sweep GC freed 168(604KB) AllocSpace objects, 51(1020KB) LOS objects, 5% free, 30MB/32MB, paused 65.635ms total 298.511ms
03-23 12:05:13.101 2417-2417/com.example.hp_user.shoutfinal28 I/art: Starting a blocking GC Alloc
03-23 12:05:13.102 2417-2417/com.example.hp_user.shoutfinal28 I/art: Starting a blocking GC Alloc
03-23 12:05:13.321 2417-2417/com.example.hp_user.shoutfinal28 I/art: Alloc sticky concurrent mark sweep GC freed 74(301KB) AllocSpace objects, 24(480KB) LOS objects, 4% free, 30MB/32MB, paused 62.666ms total 217.832ms
03-23 12:05:13.329 2417-2417/com.example.hp_user.shoutfinal28 I/art: Starting a blocking GC Alloc
03-23 12:05:13.329 2417-2417/com.example.hp_user.shoutfinal28 I/art: Starting a blocking GC Alloc
03-23 12:05:13.643 2417-2417/com.example.hp_user.shoutfinal28 I/art: Clamp target GC heap from 34MB to 32MB
03-23 12:05:13.643 2417-2417/com.example.hp_user.shoutfinal28 I/art: Alloc partial concurrent mark sweep GC freed 48(145KB) AllocSpace objects, 14(280KB) LOS objects, 4% free, 30MB/32MB, paused 63.546ms total 312.988ms
03-23 12:05:13.660 2417-2417/com.example.hp_user.shoutfinal28 I/art: Starting a blocking GC Alloc
03-23 12:05:13.661 2417-2417/com.example.hp_user.shoutfinal28 I/art: Starting a blocking GC Alloc
03-23 12:05:13.870 2417-2417/com.example.hp_user.shoutfinal28 I/art: Alloc sticky concurrent mark sweep GC freed 31(37KB) AllocSpace objects, 26(468KB) LOS objects, 3% free, 30MB/32MB, paused 63.375ms total 208.351ms
03-23 12:05:13.877 2417-2417/com.example.hp_user.shoutfinal28 I/art: Starting a blocking GC Alloc
i believe this is the class causing it to crash, before i created this class and 4th tab my app ran fine but the other two classes are pretty much empty apart from the tabs.
package com.example.hp_user.shoutfinal28;
import android.app.FragmentManager;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
public class FragmentShouts_Maps extends Fragment implements OnMapReadyCallback {
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Get the view from fragment shouts.xml
View view = inflater.inflate(R.layout.fragmentshouts_maps, container, false);
SupportMapFragment fragment = (SupportMapFragment) getChildFragmentManager().findFragmentById(R.id.maps);
if (fragment!= null) {
fragment.getMapAsync(this);
}
return view;
}
#Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
}
#Override
public void onMapReady (GoogleMap googleMap) {
}
}
here is my ViewPagerAdapter
public class ViewPagerAdapter extends FragmentPagerAdapter {
final int PAGE_COUNT = 4;
// Tab Titles
private String tabtitles[] = new String[] {"Home","Shouts","Maps","Shouters"};
Context context;
public ViewPagerAdapter(FragmentManager fm) {
super(fm);
}
#Override
public int getCount() {
return PAGE_COUNT;
}
public Fragment getItem(int position) {
switch (position) {
// Open Fragment home.java
case 0:
FragmentHome fragmenthome = new FragmentHome();
return fragmenthome;
// Open Fragment shouters.java
case 1:
FragmentShouts fragmentshouts = new FragmentShouts();
return fragmentshouts;
case 2:
FragmentShouts_Maps fragmentshouts_maps = new FragmentShouts_Maps();
return fragmentshouts_maps;
case 3:
FragmentShouters fragmentshouters = new FragmentShouters();
return fragmentshouters;
}
return null;
}
#Override
public CharSequence getPageTitle(int position) {
return tabtitles[position];
}
here is my main activity class, i think i slightly agree with you, its a sliding tab strip which isnt natural for android, more commonly seen in ios devices and it worked smoothly before the implementation of the fourth tab but i noticed my toast would react slowly when user input was stored after a button was clicked
public class MainActivity extends FragmentActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Get the view from activity_main.xml
setContentView(R.layout.activity_main);
// Locate the viewpager in activity_main.xml
ViewPager viewPager = (ViewPager) findViewById(R.id.pager);
// Set the ViewPagerAdapter into ViewPager
viewPager.setAdapter(new ViewPagerAdapter(getSupportFragmentManager()));
}
public void btnShout(View v) {
//allows for label to be changed to shouted once button is pressed
EditText txtInput = (EditText) findViewById(R.id.txtInput);
TextView lblShout = (TextView) findViewById(R.id.lblShout);
lblShout.setText("Shouted! ");
//allows for toast to be displayed once button is clicked
Toast toast = new Toast(getApplicationContext());
toast.setGravity(Gravity.TOP | Gravity.LEFT, 0, 0);
toast.makeText(MainActivity.this, txtInput.getText() + " Has Been Shouted.", toast.LENGTH_SHORT).show();
}
}
You're doing too much work on the main thread.
03-23 11:56:07.874 2417-2417/com.example.hp_user.shoutfinal28 I/Choreographer: Skipped 46 frames! The application may be doing too much work on its main thread.
03-23 11:56:09.040 2417-2417/com.example.hp_user.shoutfinal28 I/Choreographer: Skipped 67 frames! The application may be doing too much work on its main thread.
If you are in need of executing long-running code, you should take a look at Android's threading tools (http://developer.android.com/guide/components/processes-and-threads.html and http://developer.android.com/training/multiple-threads/index.html). AsyncTask (http://developer.android.com/reference/android/os/AsyncTask.html) is your friend =)

Unable to Show Progress Dialog [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I'm using ProgressDialog to show a loading page in my android app .
My code looks like :
final ProgressDialog dialog = new ProgressDialog(this);
dialog.setCancelable(false);
dialog.setMessage("please Wait ...");
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setProgressStyle(R.style.progress_dialog_style);
dialog.show();
String toastMsg = null;
LoginService loginService = new LoginService(LoginActivity.this);
ProfileDetails profileDetails = loginService.checkLogin(mobile_number.getText().toString().trim(), password.getText().toString().trim());
if(profileDetails != null && loginService.changeLogin(MainActivity.LOGIN_YES, mobile_number.getText().toString().trim())) {
toastMsg = MainActivity.LOGIN_SUCCESSFUL;
}
if(profileDetails == null) {
runOnUiThread(new Runnable() {
public void run() {
dialog.dismiss();
}
});
}
and then i perform some DB Operations and get some data
and i use dialog.dismiss().
If i get data successfully i use startActivity(intent);
Here
i) if i use dialog.dismiss() when i run the code i am not able to see the Dialog.
ii) When i remove the dialog.dimiss() section i am able to see the Dialog but unable to close it.
Please resolve this problem.
Thank You
Log i got is
12-16 00:12:42.325 2146-2172/mycompany.com.weekendmovierating W/EGL_emulation﹕ eglSurfaceAttrib not implemented
12-16 00:12:42.325 2146-2172/mycompany.com.weekendmovierating W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa34423e0, error=EGL_SUCCESS
12-16 00:12:42.632 2146-2172/mycompany.com.weekendmovierating W/EGL_emulation﹕ eglSurfaceAttrib not implemented
12-16 00:12:42.632 2146-2172/mycompany.com.weekendmovierating W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa34422e0, error=EGL_SUCCESS
12-16 00:12:42.804 2146-2160/mycompany.com.weekendmovierating I/art﹕ WaitForGcToComplete blocked for 58.235ms for cause Background
12-16 00:12:42.937 2146-2156/mycompany.com.weekendmovierating W/art﹕ Suspending all threads took: 38.186ms
12-16 00:12:42.938 2146-2160/mycompany.com.weekendmovierating W/art﹕ Suspending all threads took: 19.448ms
12-16 00:12:42.946 2146-2160/mycompany.com.weekendmovierating I/art﹕ Background sticky concurrent mark sweep GC freed 8670(494KB) AllocSpace objects, 5(100KB) LOS objects, 0% free, 5MB/5MB, paused 21.810ms total 130.763ms
12-16 00:12:43.105 2146-2160/mycompany.com.weekendmovierating W/art﹕ Suspending all threads took: 61.760ms
12-16 00:12:43.171 2146-2146/mycompany.com.weekendmovierating I/Choreographer﹕ Skipped 44 frames! The application may be doing too much work on its main thread.
12-16 00:12:43.245 2146-2160/mycompany.com.weekendmovierating I/art﹕ Background partial concurrent mark sweep GC freed 1796(126KB) AllocSpace objects, 2(76KB) LOS objects, 39% free, 5MB/9MB, paused 12.887ms total 76.159ms
12-16 00:12:43.803 2146-2172/mycompany.com.weekendmovierating W/EGL_emulation﹕ eglSurfaceAttrib not implemented
12-16 00:12:43.803 2146-2172/mycompany.com.weekendmovierating W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xb3fdece0, error=EGL_SUCCESS
12-16 00:12:44.892 1294-1313/system_process I/ActivityManager﹕ Displayed mycompany.com.weekendmovierating/mycompany.weekendmovierating.activity.SelectLanguageActivity: +2s541ms
12-16 00:12:45.023 2146-2146/mycompany.com.weekendmovierating I/Choreographer﹕ Skipped 69 frames! The application may be doing too much work on its main thread.
12-16 00:12:45.055 1545-6738/com.android.inputmethod.latin E/Surface﹕ getSlotFromBufferLocked: unknown buffer: 0xab7d6dc0
12-16 00:12:45.082 2146-2172/mycompany.com.weekendmovierating E/Surface﹕ getSlotFromBufferLocked: unknown buffer: 0xab7da1d0
12-16 00:12:45.093 2146-2172/mycompany.com.weekendmovierating E/Surface﹕ getSlotFromBufferLocked: unknown buffer: 0xab7d8870
12-16 00:12:45.148 2146-2172/mycompany.com.weekendmovierating E/Surface﹕ getSlotFromBufferLocked: unknown buffer: 0xab7d85d0
12-16 00:12:45.342 2146-2146/mycompany.com.weekendmovierating E/WindowManager﹕ android.view.WindowLeaked: Activity mycompany.weekendmovierating.activity.LoginActivity has leaked window com.android.internal.policy.PhoneWindow$DecorView{ffa0769 V.E...... R......D 0,0-760,192} that was originally added here
at android.view.ViewRootImpl.<init>(ViewRootImpl.java:368)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:299)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:85)
at android.app.Dialog.show(Dialog.java:319)
at mycompany.weekendmovierating.activity.LoginActivity.login(LoginActivity.java:87)
at java.lang.reflect.Method.invoke(Native Method)
at android.view.View$DeclaredOnClickListener.onClick(View.java:4447)
at android.view.View.performClick(View.java:5198)
at android.view.View$PerformClick.run(View.java:21147)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
12-16 00:12:45.371 2146-2156/mycompany.com.weekendmovierating W/art﹕ Suspending all threads took: 25.085ms
12-16 00:12:45.397 1294-1305/system_process W/WindowManager﹕ Failed looking up window
java.lang.IllegalArgumentException: Requested window android.os.BinderProxy#aa60cd1 does not exist
at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:8723)
at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:8714)
at com.android.server.wm.WindowManagerService.removeWindow(WindowManagerService.java:2697)
at com.android.server.wm.Session.remove(Session.java:187)
at android.view.IWindowSession$Stub.onTransact(IWindowSession.java:242)
at com.android.server.wm.Session.onTransact(Session.java:130)
at android.os.Binder.execTransact(Binder.java:453)
runOnUiThread(new Runnable() {
#Override
public void run()
{
progress.dismiss();
}
Dismiss your dialog like this in runnable thread.

Categories

Resources