I have 2 Activity, I want to send data from activity 1 to Activity 2 when clicking a list item. On clicking i can get the data mapped to that ListItem, that data is a kind of RealmList type. I used Gson library to convert my model to Json String. I can achieve this if my data is a type of List but am using RealmList. When i try to Achieve the following it my application gets freezed.
This is my filter Model :
Filter filter = new Filter();
filter.setTitle("");
filter.setId("");
filter.setCode("");
RealmList is like :
RealmList<Filter> list = new RealmList<Filter>();
I tried to convert above list to JSONObject string as follows :
new Gson().toJson(filter))
Above live giving me the following error :
PID: 12959 Reason: Input dispatching timed out (Waiting to send non-key event because the touched window has not finished processing certain input events that were delivered to it over 500.0ms ago. Wait queue length: 4. Wait queue head age: 5647.8ms.)
Load: 10.67 / 9.63 / 9.38
CPU usage from 1103ms to -6084ms ago:
101% 12959/com.anubavam.creatrix: 98% user + 3.4% kernel / faults: 6335 minor 15 major
44% 832/system_server: 25% user + 18% kernel / faults: 8128 minor 104 major
10% 1623/com.android.phone: 5.5% user + 5.4% kernel / faults: 4275 minor 57 major
3.6% 4304/android.process.media: 1.7% user + 1.9% kernel / faults: 4931 minor 73 major
0% 286/debuggerd: 0% user + 0% kernel / faults: 3205 minor 38 major
5.8% 91/kswapd0: 0% user + 5.8% kernel
5.8% 1272/com.android.systemui: 3.8% user + 1.9% kernel / faults: 2852 minor 39 major
4.5% 302/zygote: 3% user + 1.5% kernel / faults: 11239 minor
3.4% 1580/com.motorola.process.system: 2.3% user + 1.1% kernel / faults: 1881 minor 1 major
3.3% 153/mmcqd/0: 0% user + 3.3% kernel
Note List and ArrayList does not give me any error, its working file.But RealmList is the problem. I tries following line also, but no use.
List<Filter> list = new RealmList<Filter>();
can any one have work around for this.