otto

java.lang. RuntimeException No Retrofit annotation found. (parameter #3)

爷,独闯天下 提交于 2019-12-02 06:00:45
问题 I'm trying to update this RetroFit + Otto tutorial, so my code updated is: IWeather.java RetroFit 2.+ doesn't allow to return void , so instead of void getWeather(...) I added Call<Weather> getWeather(...) . public interface IWeather { @GET("/{latitude},{longitude}") Call<Weather> getWeather(@Path("latitude") String latitude, @Path("longitude") String longitude, Callback<Weather> callback); } ForecastClient.java RetroFit 2.+ has changed his constructor, so the new ForecastClient has the next

java.lang. RuntimeException No Retrofit annotation found. (parameter #3)

China☆狼群 提交于 2019-12-02 02:26:14
I'm trying to update this RetroFit + Otto tutorial , so my code updated is: IWeather.java RetroFit 2.+ doesn't allow to return void , so instead of void getWeather(...) I added Call<Weather> getWeather(...) . public interface IWeather { @GET("/{latitude},{longitude}") Call<Weather> getWeather(@Path("latitude") String latitude, @Path("longitude") String longitude, Callback<Weather> callback); } ForecastClient.java RetroFit 2.+ has changed his constructor, so the new ForecastClient has the next form. The IllegalArgumentException points to the weather.getWeather(...) method. public class

Communicative Between Fragments on Android

醉酒当歌 提交于 2019-12-02 02:24:37
I am attempting to build an Android application that has two tabs, one for a textField/button and TreeMenu (where each element has a checkbox associated with it) and another for a list. I am also using an ActionBarSherlock. I have already successfully written the program in a single main activity, but am having difficulty figuring out how to divide this original activity to correspond with the two new fragment instances I need to create for each tab. Moreover, each time an item is added in the first tab (whether it is from being checked off or added to the textField), the list in the second

Leakcanary report of memory leak using Otto

纵饮孤独 提交于 2019-11-30 17:59:50
问题 Following up on my last question, here is the second memory leak I can not get rid of.. I read that I need to register and unregister my static Otto bus according to the Activity and Fragment lifecycle, so I added the register and unregister calls to onStop and onStart... Having a button that triggers an event that is then received by some Fragments inside a Viewpager gives me the following memory leak: D/LeakCanary﹕ In com.doesnthaveadomain.leo.calendartracker:1.0:1. D/LeakCanary﹕ * com

IllegalArgumentException with Otto Event bus in Fragment instance

佐手、 提交于 2019-11-30 00:36:14
I am using Otto Event bus to subscribe to certain events in a ListFragment. The bus instance is stored and created in an subclass of Application, in other words, it bus should work as a singleton. It seems like this is not a case... The fragment is registering to the bus in onActivityCreated(Bundle) and unregistering in onDestroy() . This does not work as it should. I have gotten several crash reports from devices where the app crashes when calling unregister() (java.lang.IllegalArgumentException: Missing event handler for an annotated method...). This exception is only thrown if unregister()

Otto vs LocalBroadcast:

孤街浪徒 提交于 2019-11-28 17:25:41
I am a huge fan of open source contributions square has done to the Android community and was looking into their latest contribution Otto (event bus ) http://square.github.io/otto/ Digging deeper I see that Otto uses reflection and there is no ordered broadcast ( a pattern where a unconsumed message is handed down from one receiver to the next receiver listening on the same type of event ) Otto believes in more of a fire and forget model . Now android has LocalBroadcastManager (LBM ) in its v4 support library which serves the same purpose , though it's more bulkier and has more restrictions on

ClassNotFoundException: Didn't find class “android.os.PersistableBundle” Otto Android 5.0

感情迁移 提交于 2019-11-28 10:46:27
I have a strange issue. I have an app which I deployed on an Android 4.4 device and use Otto library. I deployed the app on an Android 5.0 device. It still works. I retried on the 4.4 and the app won't launched. Apparently, it tries to use PersistableBundle.class which a API 21 class. Here my log : Caused by: java.lang.ClassNotFoundException: Didn't find class "android.os.PersistableBundle" on path: DexPathList[[zip file "/data/app/fr.myapp.apk"],nativeLibraryDirectories=[/data/app-lib/fr.myapp, /vendor/lib, /system/lib]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56

Otto vs LocalBroadcast:

霸气de小男生 提交于 2019-11-27 10:27:04
问题 I am a huge fan of open source contributions square has done to the Android community and was looking into their latest contribution Otto (event bus ) http://square.github.io/otto/ Digging deeper I see that Otto uses reflection and there is no ordered broadcast ( a pattern where a unconsumed message is handed down from one receiver to the next receiver listening on the same type of event ) Otto believes in more of a fire and forget model . Now android has LocalBroadcastManager (LBM ) in its

How to send event from Service to Activity with Otto event bus?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-27 10:19:40
Simple BusProvider.getInstance().post() bring exception not main thread . How to send event from Service to Activity with Otto event bus? Andy Dennie To post from any thread (main or background) and receive on the main thread, try something like public class MainThreadBus extends Bus { private final Handler mHandler = new Handler(Looper.getMainLooper()); @Override public void post(final Object event) { if (Looper.myLooper() == Looper.getMainLooper()) { super.post(event); } else { mHandler.post(new Runnable() { @Override public void run() { MainThreadBus.super.post(event); } }); } } } Note:

ClassNotFoundException: Didn't find class “android.os.PersistableBundle” Otto Android 5.0

∥☆過路亽.° 提交于 2019-11-27 03:48:09
问题 I have a strange issue. I have an app which I deployed on an Android 4.4 device and use Otto library. I deployed the app on an Android 5.0 device. It still works. I retried on the 4.4 and the app won't launched. Apparently, it tries to use PersistableBundle.class which a API 21 class. Here my log : Caused by: java.lang.ClassNotFoundException: Didn't find class "android.os.PersistableBundle" on path: DexPathList[[zip file "/data/app/fr.myapp.apk"],nativeLibraryDirectories=[/data/app-lib/fr