Android:应用程序主页活动有时冻结

时间:2014-03-01 08:08:38

标签: android

我的android应用程序在运行一段时间后会冻结一段时间。 它不会在log cat中引发任何错误,但是当我启动我的应用程序时它会显示空白屏幕。 然后我不能回去或杀死它,然后我必须点击主页然后从设置 - >管理应用程序 - >选择应用 - >强制关闭 。 然后只有我可以再次运行它。然后再过一段时间,应用程序冻结。 代码如下,请提出您的宝贵意见。

Below is the error logs when application freeze :- 

    03-04 20:52:29.328: D/dalvikvm(10506): GC_EXPLICIT freed 12K, 37% free 4622K/7303K, external 408K/517K, paused 46ms
    03-04 20:52:29.898: W/FastDormancy(1541):  before ======= ENTER DORMANCY =======
    03-04 20:52:29.898: D/FastDormancy(1541): [FD] ON default: true
    03-04 20:52:29.898: D/FastDormancy(1541): [FD] gps.fd.block = false
    03-04 20:52:29.898: D/FastDormancy(1541): Before mDormFlag: true in getCapaDormancy()
    03-04 20:52:30.109: I/InputReader(1470): dispatchTouch::touch event's action is 0
    03-04 20:52:30.109: I/InputDispatcher(1470): Delivering touch to current input target: action: 0, channel '407aa9e8 com.sec.android.app.twlauncher/com.sec.android.app.twlauncher.Launcher (server)'
    03-04 20:52:30.171: I/InputReader(1470): dispatchTouch::touch event's action is 1
    03-04 20:52:30.195: D/dalvikvm(1546): GC_EXTERNAL_ALLOC freed 16K, 51% free 3386K/6791K, external 2428K/2437K, paused 46ms
    03-04 20:52:30.210: I/InputDispatcher(1470): Delivering touch to current input target: action: 1, channel '407aa9e8 com.sec.android.app.twlauncher/com.sec.android.app.twlauncher.Launcher (server)'
    03-04 20:52:30.218: I/ActivityManager(1470): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=expert.apps.hindi.news/purohit.expert.apps.activity.HomeActivity } from pid 1546
    03-04 20:52:30.257: I/Launcher(1546): onPause()
    03-04 20:52:30.265: I/OrientationDebug(1470): [pwm] in updateOrientationListenerLp()
    03-04 20:52:30.265: V/OrientationDebug(1470): in updateOrientationListenerLp(), Screen status=true, current orientation=-1, SensorEnabled=false
    03-04 20:52:30.273: I/OrientationDebug(1470): [pwm] needSensorRunningLp(), return false #3
    03-04 20:52:30.273: E/JavaBinder(1470): !!! FAILED BINDER TRANSACTION !!!
    03-04 20:52:30.304: E/JavaBinder(1470): !!! FAILED BINDER TRANSACTION !!!
    03-04 20:52:30.304: I/Launcher(1546): onWindowFocusChanged(false)
    03-04 20:52:30.304: D/Launcher(1546): setWallpaperDimension() called
    03-04 20:52:30.304: D/Launcher(1546): USE_NON_SCROLLABLE_IMAGE_WALLPAPER is true
    03-04 20:52:30.304: D/Launcher(1546): It's image wallpaper. suggestDesiredDimensions(-1,-1)
    03-04 20:52:35.132: D/dalvikvm(1470): GC_EXPLICIT freed 1398K, 37% free 7437K/11783K, external 2938K/3280K, paused 125ms
    03-04 20:52:35.171: V/AudioPolicyManager(1304): releaseOutput() 1
    03-04 20:52:35.171: V/AudioFlinger(1304): remove track (4097) and delete from mixer
    03-04 20:52:35.171: V/AudioFlinger(1304): PlaybackThread::Track destructor
    03-04 20:52:35.406: E/JavaBinder(1470): !!! FAILED BINDER TRANSACTION !!!
    03-04 20:52:35.414: E/StatusBarPolicy(1524): ecio: 255
    03-04 20:52:35.414: E/StatusBarPolicy(1524): iconLevel: 4
    03-04 20:52:35.750: D/BatteryService(1470): update start
    03-04 20:52:35.750: D/BatteryService(1470): updateBattery level:85 scale:100 status:2 health:2 present:false voltage: 4 temperature: 260 technology: Li-ion AC powered:false USB powered:true icon:17302206
    03-04 20:52:35.757: I/StatusBarPolicy(1524): BAT. S:2 H:2
    03-04 20:52:36.187: W/PowerManagerService(1470): Timer 0x3->0x3|0x1
    03-04 20:52:39.914: W/FastDormancy(1541):  before ======= ENTER DORMANCY =======
    03-04 20:52:39.914: D/FastDormancy(1541): [FD] ON default: true
    03-04 20:52:39.914: D/FastDormancy(1541): [FD] gps.fd.block = false
    03-04 20:52:39.914: D/FastDormancy(1541): Before mDormFlag: true in getCapaDormancy()
    03-04 20:52:40.226: W/ActivityManager(1470): Launch timeout has expired, giving up wake lock!
    03-04 20:52:40.281: W/ActivityManager(1470): Activity idle timeout for HistoryRecord{40aa7e28 expert.apps.hindi.news/purohit.expert.apps.activity.HomeActivity}
    03-04 20:52:40.304: W/ActivityManager(1470): Activity destroy timeout for HistoryRecord{40790cd8 expert.apps.hindi.news/purohit.expert.apps.activity.HomeActivity}
    03-04 20:52:41.210: D/dalvikvm(13630): GC_CONCURRENT freed 282K, 46% free 3442K/6279K, external 408K/517K, paused 5ms+6ms
    03-04 20:52:41.218: E/JavaBinder(1470): !!! FAILED BINDER TRANSACTION !!!
    03-04 20:52:41.226: E/StatusBarPolicy(1524): ecio: 255
    03-04 20:52:41.226: E/StatusBarPolicy(1524): iconLevel: 4
    03-04 20:52:41.601: D/dalvikvm(13179): GC_EXPLICIT freed 308K, 41% free 4647K/7815K, external 408K/517K, paused 61ms
    03-04 20:52:41.726: D/dalvikvm(13630): GC_EXPLICIT freed 254K, 47% free 3350K/6279K, external 408K/517K, paused 43ms
    03-04 20:52:42.140: D/dalvikvm(1470): GC_EXPLICIT freed 208K, 38% free 7354K/11783K, external 2287K/2856K, paused 110ms
    03-04 20:52:42.273: D/dalvikvm(13630): GC_EXPLICIT freed 191K, 48% free 3320K/6279K, external 408K/517K, paused 42ms
    03-04 20:52:42.515: D/dalvikvm(13179): GC_EXPLICIT freed 84K, 41% free 4627K/7815K, external 408K/517K, paused 59ms
    03-04 20:52:42.765: D/dalvikvm(13630): GC_EXPLICIT freed 104K, 47% free 3377K/6279K, external 408K/517K, paused 43ms
    03-04 20:52:42.937: D/BatteryService(1470): update start
    03-04 20:52:42.937: D/BatteryService(1470): updateBattery level:86 scale:100 status:2 health:2 present:false voltage: 4 temperature: 260 technology: Li-ion AC powered:false USB powered:true icon:17302206
    03-04 20:52:42.953: I/StatusBarPolicy(1524): BAT. S:2 H:2
    03-04 20:52:43.203: D/dalvikvm(13630): GC_EXPLICIT freed 199K, 47% free 3338K/6279K, external 408K/517K, paused 42ms
    03-04 20:52:43.328: D/dalvikvm(13179): GC_EXPLICIT freed 60K, 41% free 4625K/7815K, external 408K/517K, paused 58ms
    03-04 20:52:43.499: D/dalvikvm(1470): GC_EXPLICIT freed 94K, 38% free 7353K/11783K, external 2287K/2856K, paused 106ms
    03-04 20:52:43.820: D/dalvikvm(13630): GC_EXPLICIT freed 101K, 46% free 3398K/6279K, external 408K/517K, paused 42ms
    03-04 20:52:44.195: D/dalvikvm(13179): GC_EXPLICIT freed 69K, 41% free 4622K/7815K, external 408K/517K, paused 59ms
    03-04 20:52:44.343: D/dalvikvm(13630): GC_EXPLICIT freed 202K, 47% free 3357K/6279K, external 408K/517K, paused 42ms
    03-04 20:52:44.929: W/FastDormancy(1541):  before ======= ENTER DORMANCY =======
    03-04 20:52:44.929: D/FastDormancy(1541): [FD] ON default: true
    03-04 20:52:44.929: D/FastDormancy(1541): [FD] gps.fd.block = false
    03-04 20:52:44.929: D/FastDormancy(1541): Before mDormFlag: true in getCapaDormancy()
    03-04 20:52:45.781: D/BatteryService(1470): update start
    03-04 20:52:47.999: D/dalvikvm(1546): GC_EXPLICIT freed 9K, 51% free 3380K/6791K, external 2045K/2486K, paused 43ms
    03-04 20:52:49.695: E/JavaBinder(1470): !!! FAILED BINDER TRANSACTION !!!
    03-04 20:52:49.703: E/StatusBarPol`enter code here`icy(1524): ecio: 255
    03-04 20:52:49.703: E/StatusBarPolicy(1524): iconLevel: 4
    03-04 20:52:49.937: W/FastDormancy(1541):  before ======= ENTER DORMANCY =======

以下是家庭活动的代码:

public class HomeActivity extends Activity  {
                private Context context;
                private OrderdProperties prop ;
                private StartAppAd startAppAd ;


                @Override
                protected void onCreate(Bundle savedInstanceState) {
                    super.onCreate(savedInstanceState);
                    setContentView(R.layout.activity_home);
                    initStartAppAds();
                    context = this;
                    Button webNewsView = (Button) findViewById(R.id.web);

                    if(prop == null || prop.size() == 0){
    //reading prop file
                        prop = NewsHelper.populateConfigProperties(this.getResources(),"news_summary_list.properties");
                        }
                        final ListView listview = (ListView) findViewById(R.id.list);
                        listview.setAdapter(new NewsListAdapter(this,  prop.values().toArray(new String[0])));
                        listview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
                            @Override
                            public void onItemClick(AdapterView<?> parent, final View view,
                                int position, long id) {
                            final String item = (String) parent.getItemAtPosition(position);
                            Intent intent = new Intent(context, RssReaderActivity.class);
                            String newsUrlKey = NewsHelper.getMapKey(prop, item);
                            intent.putExtra("source", newsUrlKey);
                            intent.putExtra("news", item);
                            startActivity(intent);
                            }
                          });
                    //click listner
                    webNewsView.setOnClickListener(new OnClickListener() {
                        @Override
                        public void onClick(View arg0) {
                            Intent intent = new Intent(context, WebNews.class);
                            startActivity(intent);
                        }
                    });
                }

                    //ads integration
                private void initStartAppAds() {
                    //start up adds initialization
                    try{
                    StartAppSearch.showSearchBox(this);
                    StartAppAd.init(this, Constants.DEV_ID, Constants.APP_ID);
                    StartAppSearch.init(this, Constants.DEV_ID, Constants.APP_ID);
                    startAppAd =new StartAppAd(this);
                    final Banner ban = (Banner)findViewById(R.id.startAppBanner);
                    startAppAd.showAd();
                    startAppAd.loadAd(new AdEventListener() {
                        @Override
                        public void onReceiveAd(Ad ad) {
                            ban.setVisibility(View.VISIBLE);
                        }
                        @Override
                        public void onFailedToReceiveAd(Ad ad) {
//hiding banner
                            ban.setVisibility(View.GONE);
                        }
                        });
                    }
                    catch(Exception e){
                        e.printStackTrace();
                    }
                }

0 个答案:

没有答案