mView has no focus+DecorView setVisiblity: visibility = 4+Finishing stop of ActivityRecord

09-24 18:22:23.692: E/AndroidRuntime(22703): FATAL EXCEPTION: main
09-24 18:22:23.692: E/AndroidRuntime(22703): Process: com.example.nongmin, PID: 22703
09-24 18:22:23.692: E/AndroidRuntime(22703): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.nongmin/com.jarvis.user.info.UApplyedActivity}: android.view.InflateException: Binary XML file line #17: Error inflating class com.clockrock.widget.PullToRefreshLayout
09-24 18:22:23.692: E/AndroidRuntime(22703): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2392)
09-24 18:22:23.692: E/AndroidRuntime(22703): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2443)
09-24 18:22:23.692: E/AndroidRuntime(22703): at android.app.ActivityThread.access$800(ActivityThread.java:157)
09-24 18:22:23.692: E/AndroidRuntime(22703): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1354)
09-24 18:22:23.692: E/AndroidRuntime(22703): at android.os.Handler.dispatchMessage(Handler.java:110)
09-24 18:22:23.692: E/AndroidRuntime(22703): at android.os.Looper.loop(Looper.java:193)
09-24 18:22:23.692: E/AndroidRuntime(22703): at android.app.ActivityThread.main(ActivityThread.java:5348)
09-24 18:22:23.692: E/AndroidRuntime(22703): at java.lang.reflect.Method.invokeNative(Native Method)
09-24 18:22:23.692: E/AndroidRuntime(22703): at java.lang.reflect.Method.invoke(Method.java:515)
09-24 18:22:23.692: E/AndroidRuntime(22703): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:829)
09-24 18:22:23.692: E/AndroidRuntime(22703): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:645)
09-24 18:22:23.692: E/AndroidRuntime(22703): at dalvik.system.NativeStart.main(Native Method)
09-24 18:22:23.692: E/AndroidRuntime(22703): Caused by: android.view.InflateException: Binary XML file line #17: Error inflating class com.clockrock.widget.PullToRefreshLayout
09-24 18:22:23.692: E/AndroidRuntime(22703): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:707)
09-24 18:22:23.692: E/AndroidRuntime(22703): at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
09-24 18:22:23.692: E/AndroidRuntime(22703): at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
09-24 18:22:23.692: E/AndroidRuntime(22703): at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
09-24 18:22:23.692: E/AndroidRuntime(22703): at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
09-24 18:22:23.692: E/AndroidRuntime(22703): at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
09-24 18:22:23.692: E/AndroidRuntime(22703): at com.jarvis.user.info.UApplyedActivity.onCreate(UApplyedActivity.java:47)
09-24 18:22:23.692: E/AndroidRuntime(22703): at android.app.Activity.performCreate(Activity.java:5451)
09-24 18:22:23.692: E/AndroidRuntime(22703): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1097)
09-24 18:22:23.692: E/AndroidRuntime(22703): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2346)
09-24 18:22:23.692: E/AndroidRuntime(22703): ... 11 more
09-24 18:22:23.692: E/AndroidRuntime(22703): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.clockrock.widget.PullToRefreshLayout" on path: DexPathList[[zip file "/data/app/com.example.nongmin-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.nongmin-2, /vendor/lib, /system/lib]]
09-24 18:22:23.692: E/AndroidRuntime(22703): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
09-24 18:22:23.692: E/AndroidRuntime(22703): at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
09-24 18:22:23.692: E/AndroidRuntime(22703): at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
09-24 18:22:23.692: E/AndroidRuntime(22703): at android.view.LayoutInflater.createView(LayoutInflater.java:559)
09-24 18:22:23.692: E/AndroidRuntime(22703): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
09-24 18:22:23.692: E/AndroidRuntime(22703): ... 20 more


错误原因:自定义布局没有搞




09-24 18:42:59.296: V/ActivityThread(23911): Finishing stop of ActivityRecord{42556780 token=android.os.BinderProxy@42555df8 {com.example.nongmin/com.jarvis.mytaobao.home.Main_FA}}: show=false win=com.android.internal.policy.impl.PhoneWindow@42626968
09-24 18:42:59.296: V/PhoneWindow(23911): DecorView setVisiblity: visibility = 4 ,Parent =ViewRoot{425587f8 com.example.nongmin/com.jarvis.mytaobao.home.Main_FA,ident = 0}, this =com.android.internal.policy.impl.PhoneWindow$DecorView{426278f8 I.E..... R....... 0,0-1080,1920}


09-24 18:47:02.781: V/ActivityThread(24144): Finishing stop of ActivityRecord{42561c30 token=android.os.BinderProxy@425612a8 {com.example.nongmin/com.jarvis.mytaobao.home.Main_FA}}: show=false win=com.android.internal.policy.impl.PhoneWindow@42581038
09-24 18:47:02.782: V/PhoneWindow(24144): DecorView setVisiblity: visibility = 4 ,Parent =ViewRoot{4255d6d0 com.example.nongmin/com.jarvis.mytaobao.home.Main_FA,ident = 0}, this =com.android.internal.policy.impl.PhoneWindow$DecorView{42581e68 I.E..... R....... 0,0-1080,1920}


09-24 18:52:35.296: D/ActivityThread(24420): ACT-STOP_ACTIVITY_HIDE handled : 0 / android.os.BinderProxy@4255eed0




09-24 19:06:15.949: W/ViewRootImpl(25176): mView has no focus, use com.android.internal.policy.impl.PhoneWindow$DecorView{441e4480 V.E..... R.....ID 0,0-1080,1920} instead








09-24 19:28:16.927: V/InputMethodManager(25968): onWindowFocus: null softInputMode=288 first=true flags=#1810100
09-24 19:28:16.928: V/InputMethodManager(25968): START INPUT: com.android.internal.policy.impl.PhoneWindow$DecorView{44095670 V.E..... R.....ID 0,0-1080,1920} ic=null tba=android.view.inputmethod.EditorInfo@440b8f20 controlFlags=#104
09-24 19:28:16.934: W/ViewRootImpl(25968): mView has no focus, use com.android.internal.policy.impl.PhoneWindow$DecorView{44095670 V.E..... R.....ID 0,0-1080,1920} instead
09-24 19:28:16.942: D/GraphicBuffer(25968): register, handle(0x7b8a1f18) (w:1080 h:1920 s:1088 f:0x1 u:0x000900)
09-24 19:28:16.954: D/OpenGLRenderer(25968): Flushing caches (mode 0)
09-24 19:28:16.956: D/GraphicBuffer(25968): unregister, handle(0x7b4f08e0) (w:1080 h:1920 s:1088 f:0x1 u:0x000900)
09-24 19:28:16.957: D/GraphicBuffer(25968): unregister, handle(0x7b508798) (w:1080 h:1920 s:1088 f:0x1 u:0x000900)
09-24 19:28:16.959: D/GraphicBuffer(25968): unregister, handle(0x7b899978) (w:1080 h:1920 s:1088 f:0x1 u:0x000900)
09-24 19:28:16.960: D/GraphicBuffer(25968): unregister, handle(0x7b396148) (w:1080 h:1920 s:1088 f:0x1 u:0x000900)
09-24 19:28:17.292: V/ActivityThread(25968): Finishing stop of ActivityRecord{4255f890 token=android.os.BinderProxy@4255ef08 {com.example.nongmin/com.jarvis.mytaobao.home.Main_FA}}: show=false win=com.android.internal.policy.impl.PhoneWindow@4262bcd0
09-24 19:28:17.293: V/PhoneWindow(25968): DecorView setVisiblity: visibility = 4 ,Parent =ViewRoot{42561908 com.example.nongmin/com.jarvis.mytaobao.home.Main_FA,ident = 0}, this =com.android.internal.policy.impl.PhoneWindow$DecorView{4262cb00 I.E..... R....... 0,0-1080,1920}
09-24 19:28:17.293: D/ActivityThread(25968): ACT-STOP_ACTIVITY_HIDE handled : 0 / android.os.BinderProxy@4255ef08

09-24 19:28:17.397: D/GraphicBuffer(25968): unregister, handle(0x7ab5a4c0) (w:534 h:105 s:544 f:0x1 u:0x000933)


上面的错误都是:少了一行代码  setContentView(view);

标题的错误是:少了一行代码  setContentView(view);




帮我用mockito编写下面代码的单元测试 package com.st.systemsettings.presenter; import android.content.Context; import android.util.Log; import com.st.systemsettings.R; import com.st.systemsettings.base.BasePresenter; import com.st.systemsettings.contract.TimeContract; import com.st.systemsettings.interfa.TimeChangeListener; import com.st.systemsettings.manager.SystemNotifyManager; import com.st.systemsettings.manager.TimeManager; public class TimeManagerPresenterImpl implements BasePresenter<TimeContract.View> { private static final String TAG = "TimeManagerPresenterImp"; private TimeContract.View mView; private TimeManager mTimeManager; private Context mContext; @Override public void registerView(TimeContract.View view) { this.mView = view; this.mContext = view.getContext(); mTimeManager = TimeManager.getInstance(); mTimeManager.setTimeChangeListener(mTimeChangeListener); } @Override public void init() { if (mView != null) { mView.updateWatchSwitch(mTimeManager.getWatchSwitch(), mTimeManager.getRestSwitch()); mView.updateWatchTime(mTimeManager.getWatchTime() + mContext.getResources().getString(R.string.time_item_manager_unit_minute)); mView.updateRestSwitch(mTimeManager.getRestSwitch()); mView.updateRestTime(mTimeManager.getRestTime() + mContext.getResources().getString(R.string.time_item_manager_unit_minute)); } } public void clickSwitchWatch(boolean open) { Log.i(TAG, "clickSwitchWatch: open = " + open); mTimeManager.setWatchSwitch(open); } public void clickWatchTime(int time) { Log.i(TAG, "clickWatchTime: time = " + time); mTimeManager.setWatchTime(time); } public void clickSwitchRest(boolean open) { Log.i(TAG, "clickSwitchRest: open = " + open); mTimeManager.setRestSwitch(open); } public void clickRestTime(int time) { Log.i(TAG, "clickRestTime: time = " + time); mTimeManager.setRestTime(time); } public void updateSettingFocus(int type) { SystemNotifyManager.getInstance().onSettingsClearFocus(type); } public boolean getSingeWatch() { return mTimeManager.getWatchSwitch(); } private final TimeChangeListener mTimeChangeListener = new TimeChangeListener() { @Override public void onWatchSwitchChanged(boolean open) { Log.i(TAG, "onWatchSwitchChanged: open = " + open); if (mView != null) { mView.updateWatchSwitch(open, mTimeManager.getRestSwitch()); } } @Override public void onWatchTimeChanged(int time) { Log.i(TAG, "onWatchTimeChanged: time = " + time); if (mView != null) { mView.updateWatchTime(mTimeManager.getWatchTime() + mContext.getResources().getString(R.string.time_item_manager_unit_minute)); } } @Override public void onRestSwitchChanged(boolean open) { Log.i(TAG, "onRestSwitchChanged: open = " + open); if (mView != null) { mView.updateRestSwitch(open); } } @Override public void onRestTimeChanged(int time) { Log.i(TAG, "onRestTimeChanged: time = " + time); if (mView != null) { mView.updateRestTime(mTimeManager.getRestTime() + mContext.getResources().getString(R.string.time_item_manager_unit_minute)); } } }; @Override public void unRegisterView() { } }
最新发布
07-25
好的,没有问题,继续帮我编写下面类的单元测试 package com.st.systemsettings.presenter; import android.util.Log; import com.optix.display.adaptor.IOptixDisplay; import com.st.systemsettings.base.BasePresenter; import com.st.systemsettings.contract.DisplayContract; import com.st.systemsettings.manager.DisplayManager; import com.st.systemsettings.manager.OptixDisplayManager; import com.st.systemsettings.manager.SystemNotifyManager; public class DisplayPresenterImpl implements BasePresenter<DisplayContract.View> { private static final String TAG = "DisplayPresenterImpl"; private DisplayContract.View mView; private DisplayManager mDisplay; private OptixDisplayManager mOptixDisplayManager; @Override public void registerView(DisplayContract.View view) { mView = view; } @Override public void unRegisterView() { mView = null; } @Override public void init() { Log.i(TAG, "init: "); mDisplay = DisplayManager.getInstance(); mOptixDisplayManager = OptixDisplayManager.getInstance(); mView.updateFountSize(mDisplay.getFontSize()); mView.updateThemeMode(mDisplay.getThemeMode()); mView.updateBrightnessAuto(mDisplay.getBrightnessModeAutomatic()); mView.updateMousePointer(mDisplay.getMousePointer()); mView.updatePowerSwitch(mDisplay.isPowerMode()); mOptixDisplayManager.setOptixDisplayListener(mOptixDisplayListener); } public void clickPowerMode(boolean check) { mDisplay.enablePowerSaveMode(!check); if (mView != null) { mView.updatePowerSwitch(mDisplay.isPowerMode()); } } public void adjustBrightness(int value) { Log.i(TAG, "adjustBrightness: value = " + value); mDisplay.setBrightValue(value * 5); } public void clickBrightAuto(boolean check) { mDisplay.setBrightnessModeAutomatic(check); } public void clickMousePointer(boolean check) { Log.i(TAG, "clickMousePointer: check = " + check); mDisplay.setMousePointer(check); mView.updateMousePointer(check); } public void clickFountItem(float size) { Log.i(TAG, "clickFountItem: size = " + size); mDisplay.setFontSize(size); if (mView != null) mView.updateFountSize(size); } public void clickThemeItem(int position) { mDisplay.setThemeMode(position); if (mView != null) mView.updateThemeMode(position); } public void updateSettingFocus(int type) { Log.i(TAG, "updateSettingFocus: type = " + type); SystemNotifyManager.getInstance().onSettingsClearFocus(type); } private final OptixDisplayManager.OptixDisplayListener mOptixDisplayListener = new OptixDisplayManager.OptixDisplayListener() { @Override public void onBrightnessChanged(int value) { Log.i(TAG, "onBrightnessChanged: value = " + value); if (mView != null) { mView.updateBrightnessValue(value / 5); } } @Override public void onBrightnessModeChanged(int mode) { Log.i(TAG, "onBrightnessModeChange: mode = " + mode); if (mView != null) { mView.updateBrightnessAuto(mode == IOptixDisplay.MODE_AUTO); } } }; }
07-24
非常好,继续帮我编写下面代码的单元测试 package com.st.systemsettings.presenter; import android.util.Log; import com.st.systemsettings.base.BasePresenter; import com.st.systemsettings.contract.PictureContract; import com.st.systemsettings.manager.PictureManager; import com.st.systemsettings.manager.SystemNotifyManager; public class PicturePresenterImpl implements BasePresenter<PictureContract.View> { private static final String TAG = "PicturePresenterImpl"; private PictureContract.View mView; private PictureManager mPictureManager; @Override public void registerView(PictureContract.View view) { this.mView = view; } @Override public void unRegisterView() { mView = null; } @Override public void init() { mPictureManager = PictureManager.getInstance(); mPictureManager.setPictureModeChangedListener(mPictureModeChangedListener); int result = mPictureManager.getPictureMode(); if (mView != null) { mView.updatePictureMode(result); } } public void clickItem(int position) { Log.i(TAG, "clickItem: position = " + position); mPictureManager.setPictureMode(position); } public void updateSettingFocus(int type) { Log.i(TAG, "updateSettingFocus: type = " + type); SystemNotifyManager.getInstance().onSettingsClearFocus(type); } private final PictureManager.PictureModeChangedListener mPictureModeChangedListener = new PictureManager.PictureModeChangedListener() { @Override public void onPictureModeChanged(int mode) { Log.i(TAG, "onPictureModeChanged: mode = " + mode); if (mView != null) { mView.updatePictureMode(mode); } } }; }
07-24
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值