title: Application Crash on loading listview inonly OS 4.0 in Android?
body: <p>I am working on an application which runs superbly on my each and every device but crashes on Android 4.0 of client. Below are the logs:</p>
  
  <p>Please look for this line "I/Choreographer(  361): Skipped 160 frames!  The application may be doing too much work on its main thread." in logs.</p>
  
  <pre><code>--------- beginning of /dev/log/system
  I/ActivityManager(  395): START {act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10200000 cmp=com.android.launcher/com.android.launcher2.Launcher u=0} from pid 395
  I/ActivityManager(  395): No longer want com.noshufou.android.su (pid 32427): hidden #16
  I/ActivityManager(  395): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.weg.ecatalogfragment/.SplashScreen u=0} from pid 817
  --------- beginning of /dev/log/main
  D/dalvikvm(  395): GC_FOR_ALLOC freed 1465K, 38% free 15471K/24775K, paused 74ms, total 74ms
  I/dalvikvm-heap(  395): Grow heap (frag case) to 24.214MB for 1048592-byte allocation
  I/ActivityManager(  395): Start proc com.weg.ecatalogfragment for activity com.weg.ecatalogfragment/.SplashScreen: pid=361 uid=10111 gids={3003, 1015, 1023, 1028}
  E/Trace   (  361): error opening trace file: No such file or directory (2)
  D/libEGL  (  361): loaded /system/lib/egl/libEGL_tegra.so
  D/libEGL  (  361): loaded /system/lib/egl/libGLESv1_CM_tegra.so
  D/libEGL  (  361): loaded /system/lib/egl/libGLESv2_tegra.so
  D/OpenGLRenderer(  361): Enabling debug mode 0
  I/ActivityManager(  395): Displayed com.weg.ecatalogfragment/.SplashScreen: +476ms
  V/        (  395): void cb_onMotion(uint16_t)
  I/ActivityManager(  395): START {flg=0x4000000 cmp=com.weg.ecatalogfragment/.ECatalogFragmentActivity u=0} from pid 361
  I/System.out(  361): gdfgdgcvbccccccccccccccccccc 0
  D/dalvikvm(  361): GC_CONCURRENT freed 1477K, 31% free 5683K/8195K, paused 3ms+2ms, total 19ms
  I/ActivityManager(  395): Displayed com.weg.ecatalogfragment/.ECatalogFragmentActivity: +345ms
  I/fdhttpd (29030): battery level:85 plugged:0
  W/InputMethodManagerService(  395): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@41edb798 attribute=null
  W/InputMethodManagerService(  395): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@41f32a40 attribute=null
  V/        (  395): void cb_onMotion(uint16_t)
  D/dalvikvm(  361): GC_CONCURRENT freed 1060K, 25% free 6420K/8455K, paused 2ms+6ms, total 27ms
  W/InputMethodManagerService(  395): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@426f5a98 attribute=null
  W/InputMethodManagerService(  395): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@41f88e20 attribute=null
  W/InputMethodManagerService(  395): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@41f60498 attribute=null
  D/dalvikvm(  361): GC_CONCURRENT freed 1636K, 29% free 6575K/9159K, paused 2ms+17ms, total 44ms
  I/System.out(  361): gdfgdgcvbccccccccccccccccccc 0
  D/dalvikvm(  361): GC_FOR_ALLOC freed 825K, 37% free 5893K/9287K, paused 16ms, total 16ms
  I/dalvikvm-heap(  361): Grow heap (frag case) to 13.937MB for 80656-byte allocation
  I/ActivityManager(  395): Start proc android.process.acore for content provider com.android.providers.contacts/.ContactsProvider2: pid=396 uid=10001 gids={3003, 1015, 1023, 1028}
  W/InputMethodManagerService(  395): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4250a310 attribute=null
  E/Trace   (  396): error opening trace file: No such file or directory (2)
  I/ActivityThread(  396): Pub call_log: com.android.providers.contacts.CallLogProvider
  I/ActivityThread(  396): Pub com.android.voicemail: com.android.providers.contacts.VoicemailContentProvider
  I/ActivityThread(  396): Pub user_dictionary: com.android.providers.userdictionary.UserDictionaryProvider
  I/ActivityThread(  396): Pub applications: com.android.providers.applications.ApplicationsProvider
  I/ActivityThread(  396): Pub contacts;com.android.contacts: com.android.providers.contacts.ContactsProvider2
  I/ActivityManager(  395): No longer want com.tmobile.thememanager (pid 32525): hidden #16
  D/dalvikvm(  395): GC_EXPLICIT freed 1610K, 41% free 15343K/25863K, paused 7ms+7ms, total 94ms
  **I/Choreographer(  361): Skipped 160 frames!  The application may be doing too much work on its main thread.**
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2723.0ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2713.7ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2704.3ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2694.8ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2685.5ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2675.9ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2666.6ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2656.8ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2647.7ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2638.3ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2628.7ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2619.3ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2609.9ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2600.5ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2591.1ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2581.6ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2572.2ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2562.7ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2553.0ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2543.7ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2534.3ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2524.7ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2515.3ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2505.9ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2496.3ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2486.9ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2477.4ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2468.0ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2458.4ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2449.0ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2439.5ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2429.9ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2420.4ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2411.0ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2401.5ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2391.4ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2382.5ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2373.1ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2363.6ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2354.1ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2344.6ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2335.1ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2325.6ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2316.3ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2306.8ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2297.3ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2287.8ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2278.3ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2268.8ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2259.4ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2249.9ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  I/InputDispatcher(  395): Window 'Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}' spent 2230.5ms processing the last input event: MotionEvent(action=2, deviceId=2, source=0x00001002)
  D/dalvikvm(32180): GC_FOR_ALLOC freed 1290K, 33% free 6329K/9351K, paused 19ms, total 19ms
  V/        (  395): void cb_onMotion(uint16_t)
  D/AndroidRuntime(  361): Shutting down VM
  W/dalvikvm(  361): threadid=1: thread exiting with uncaught exception (group=0x41ba4300)
  E/AndroidRuntime(  361): FATAL EXCEPTION: main
  E/AndroidRuntime(  361): android.os.NetworkOnMainThreadException
  E/AndroidRuntime(  361): at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1117)
  E/AndroidRuntime(  361): at java.net.InetAddress.lookupHostByName(InetAddress.java:385)
  E/AndroidRuntime(  361): at java.net.InetAddress.getAllByNameImpl(InetAddress.java:236)
  E/AndroidRuntime(  361): at java.net.InetAddress.getAllByName(InetAddress.java:214)
  E/AndroidRuntime(  361): at libcore.net.http.HttpConnection.&lt;init&gt;(HttpConnection.java:70)
  E/AndroidRuntime(  361): at libcore.net.http.HttpConnection.&lt;init&gt;(HttpConnection.java:50)
  E/AndroidRuntime(  361): at libcore.net.http.HttpConnection$Address.connect(HttpConnection.java:341)
  E/AndroidRuntime(  361): at libcore.net.http.HttpConnectionPool.get(HttpConnectionPool.java:87)
  E/AndroidRuntime(  361): at libcore.net.http.HttpConnection.connect(HttpConnection.java:128)
  E/AndroidRuntime(  361): at libcore.net.http.HttpEngine.openSocketConnection(HttpEngine.java:315)
  E/AndroidRuntime(  361): at libcore.net.http.HttpEngine.connect(HttpEngine.java:310)
  E/AndroidRuntime(  361): at libcore.net.http.HttpEngine.sendSocketRequest(HttpEngine.java:289)
  E/AndroidRuntime(  361): at libcore.net.http.HttpEngine.sendRequest(HttpEngine.java:239)
  E/AndroidRuntime(  361): at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:273)
  E/AndroidRuntime(  361): at libcore.net.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:168)
  E/AndroidRuntime(  361): at java.net.URL.openStream(URL.java:462)
  E/AndroidRuntime(  361): at com.weg.ecatalogfragment.drawing.DrawingScreenFragment.createDrawableFromURL(DrawingScreenFragment.java:430)
  E/AndroidRuntime(  361): at com.weg.ecatalogfragment.drawing.DrawingScreenFragment.handleResponse(DrawingScreenFragment.java:399)
  E/AndroidRuntime(  361): at com.weg.ecatalogfragment.drawing.DrawingScreenFragment.access$0(DrawingScreenFragment.java:342)
  E/AndroidRuntime(  361): at com.weg.ecatalogfragment.drawing.DrawingScreenFragment$1.dispatchMessage(DrawingScreenFragment.java:148)
  E/AndroidRuntime(  361): at android.os.Looper.loop(Looper.java:137)
  E/AndroidRuntime(  361): at android.app.ActivityThread.main(ActivityThread.java:4931)
  E/AndroidRuntime(  361): at java.lang.reflect.Method.invokeNative(Native Method)
  E/AndroidRuntime(  361): at java.lang.reflect.Method.invoke(Method.java:511)
  E/AndroidRuntime(  361): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
  E/AndroidRuntime(  361): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:558)
  E/AndroidRuntime(  361): at dalvik.system.NativeStart.main(Native Method)
  W/ActivityManager(  395):   Force finishing activity com.weg.ecatalogfragment/.ECatalogFragmentActivity
  W/ActivityManager(  395): Activity pause timeout for ActivityRecord{41eff160 com.weg.ecatalogfragment/.ECatalogFragmentActivity}
  I/ActivityManager(  395): No longer want com.google.android.partnersetup (pid 32633): hidden #16
  I/Process (  361): Sending signal. PID: 361 SIG: 9
  I/ActivityManager(  395): Process com.weg.ecatalogfragment (pid 361) has died.
  I/WindowState(  395): WIN DEATH: Window{4263ad58 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}
  I/WindowState(  395): WIN DEATH: Window{4243db28 com.weg.ecatalogfragment/com.weg.ecatalogfragment.ECatalogFragmentActivity paused=false}
  W/InputMethodManagerService(  395): Got RemoteException sending setActive(false) notification to pid 361 uid 10111
  W/BackupManagerService(  395): dataChanged but no participant pkg='com.android.providers.settings' uid=10035
  W/InputMethodManagerService(  395): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@424578c0 attribute=null
  W/ActivityManager(  395): Activity destroy timeout for ActivityRecord{41eff160 com.weg.ecatalogfragment/.ECatalogFragmentActivity}
  I/ActivityManager(  395): START {act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10200000 cmp=com.android.launcher/com.android.launcher2.Launcher u=0} from pid 395
  I/Gmail   (32707): MainSyncRequestProto: lowestBkwdConvoId: 0, highestHandledServerOp: 1359460, normalSync: true
  D/dalvikvm(32180): GC_FOR_ALLOC freed 1421K, 31% free 6532K/9351K, paused 13ms, total 13ms
  D/dalvikvm(32707): GC_EXPLICIT freed 3952K, 64% free 2963K/8195K, paused 3ms+2ms, total 52ms
  I/Gmail   (32707): MainSyncRequestProto: lowestBkwdConvoId: 0, highestHandledServerOp: 1359460, normalSync: true
  I/Gmail   (32707): lowestBackward conversation id 0
  I/ActivityManager(  395): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=org.jtb.alogcat/.LogActivity u=0} from pid 817
  </code></pre>
  
  <p>And the code of the specified ECatalogFragment class is:</p>
  
  <pre><code>public class ECatalogFragmentActivity extends FragmentActivity implements OnClickListener{
  
      private static final String ImageButton = null;
      private Fragment homeScreenFragment;
      private Fragment imageFragment;
      private ImageButton _pdfIcon=null;
      private TextView _pdfText=null;
      FragmentManager fm = getSupportFragmentManager();
      private FragmentTransaction fragmentTransaction;
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
  
          if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
              int count=fm.getBackStackEntryCount();
              System.out.println("gdfgdgcvbccccccccccccccccccc "+count);
              for(int i = 0; i &lt; count; ++i) {    
                  fm.popBackStack();
              }
  
              //  fm.popBackStack(null,android.app.FragmentManager.POP_BACK_STACK_INCLUSIVE);
              _pdfIcon=(ImageButton)findViewById(R.id.pdf_icon);
              _pdfIcon.setOnClickListener(this);
  
              _pdfText=(TextView)findViewById(R.id.pdf_txt);
              _pdfText.setVisibility(View.GONE);
              _pdfIcon.setVisibility(View.GONE);
  
          }
  
          RelativeLayout rel =(RelativeLayout)findViewById(R.id.top_right_datasheet_relative_layout);
          if (rel == null) {
          } else {
              /**
               * First Method:
               * leftFragment is added in main.xml and here we get a reference to the fragment
               */
              homeScreenFragment = getSupportFragmentManager().findFragmentById(R.id.homescreen_frag);
  
              /**
               * Second Method:
               * topRightFragment is not defined in main.xml.  Management is done all in code.
               * top_right_relative_layout is a relative layout in main.xml
               */
  
              imageFragment = new ImageFragment();
              fragmentTransaction = this.getSupportFragmentManager().beginTransaction();
              fragmentTransaction.add(R.id.top_right_splash_relative_layout, imageFragment, "imageFragmentTag"); //First parameter is the container id
              fragmentTransaction.show(imageFragment);
              fragmentTransaction.commit();
          }
  
      }
  
  
      public void onClick(View v) {
          if(v==_pdfIcon)
          {
              _pdfText.setVisibility(View.GONE);
              _pdfIcon.setVisibility(View.GONE);
              GetPDFScreenFragment getPDFFragment = new GetPDFScreenFragment();
              fragmentTransaction = this.getSupportFragmentManager().beginTransaction();
              fragmentTransaction.add(R.id.top_right_Drawing_relative_layout, getPDFFragment, "rightDrawingFragmentTag"); //First parameter is the container id
              fragmentTransaction.show(getPDFFragment);
              fragmentTransaction.addToBackStack("3");
              fragmentTransaction.commit();
          }
  
      }
  
      @SuppressWarnings("static-access")
      @Override
      public boolean onKeyDown(int keyCode, KeyEvent event) {
          if(keyCode==event.KEYCODE_BACK)
          {
  
              int count=fm.getBackStackEntryCount();
              System.out.println("gdfgdgcvbccccccccccccccccccc "+count);
  
              if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE)
              {
                  if(count==0)
                  {
                      for(int i = 0; i &lt; count; ++i) {    
                          fm.popBackStack();
                      }                       
                      _pdfText.setVisibility(View.GONE);
                      _pdfIcon.setVisibility(View.GONE);
  
                  }else if(count==1)
                  {    
                      finish();
                      Intent intent = new Intent(this, ECatalogFragmentActivity.class);
                      startActivity(intent);
                      _pdfText.setVisibility(View.GONE);
                      _pdfIcon.setVisibility(View.GONE);
  
                  }
                  else 
                  {
                      _pdfText.setVisibility(View.VISIBLE);
                      _pdfIcon.setVisibility(View.VISIBLE);
                  }
  
              }
          }
          return super.onKeyDown(keyCode, event);
      }
  
      @Override
      protected void onResume() {
          super.onResume();
      }
  
  }
  </code></pre>