Questions tagged [commonsware-cwac]

Questions about the CommonsWare CWAC series of Android libraries.

Mark Murphy, who helps here at Stack Overflow as CommonsWare, has published the CommonsWare Android Components (CWAC for short).

Questions tagged with should pertain to one (or more) of the CWAC libraries.

398 questions
35
votes
3 answers

Sending message to a Handler on a dead thread when getting a location from an IntentService

My app needs location fixes on regular basis, even when the phone is not awake. To do this, I am using IntentService with the pattern generously provided by Commonsware. https://github.com/commonsguy/cwac-wakeful To get location fixes, I rely on the…
znat
  • 13,144
  • 17
  • 71
  • 106
21
votes
3 answers

ListView random IndexOutOfBoundsException on Froyo

I have an app with tons of downloads and I'm receiving a lot of this error: 16783 AndroidRuntime E java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0 16783 AndroidRuntime E at…
Draiken
  • 3,805
  • 2
  • 30
  • 48
11
votes
5 answers

Merge multiple RecyclerView.Adapter for use with single RecyclerView (Android)

I have a json string which I break up into 4 datasets, each dataset has it's own RecyclerView.Adapter. I want to output all adapters in the same RecyclerView ideally with StickyHeaders for each adapter. I believe this can be done using ListViews via…
wrik
  • 213
  • 3
  • 10
7
votes
1 answer

Loader: onLoadFinished called only once

I have one loader being used in an activity. I'm able to start the loader and it onLoadFinished is called. When I update data and call onContentChanged in the loader i see that loadInBackground and deliverResult are both called. This is where the…
7
votes
2 answers

Save/Retrieve the "Rich Formatted Text" in the database without losing its Format

I am using commonsguy / cwac-richedit Library for Rich Text Editing. After doing so i am saving the formatted text in the database. But when i retrieve the saved formatted string its formatting is removed. I want to know that how to save/retrieve…
Shajeel Afzal
  • 5,913
  • 6
  • 43
  • 70
6
votes
2 answers

By the power of MergeAdapter, StickyListHeaders and ListViewAnimations combined I'm captain Android

Has anyone joined MergeAdapter, StickyListHeaders and ListViewAnimations android libraries? My needs are: multiple ListViews in one vertically scrolled view heterogenous item views multiple list items separated by headers, which should be…
fada21
  • 3,188
  • 1
  • 22
  • 21
5
votes
0 answers

Android app used with a pre-populated Encrypted SQLite database stored in Assets folder

-Using Android-Room i'm working on a project where i have to make an android app with a pre populated encrypted SQLite database stored in the Assets folder . -When dealing with a non encrypted database i managed to copy the database file from the…
0v3rFl0w
  • 45
  • 5
5
votes
3 answers

Android Camera won't take picture when screen off

I have a simple app that has an activity being called periodically by an alarm manager to display a preview frame and take a picture when the preview frame is built.After taking the picture, it is saved using a AsyncTask and the activity destroyed…
5
votes
1 answer

Camera preview quality in Android is poor

I am making a Camera app in Android and have used the following function to get the preview size: private Size getOptimalPreviewSize(List sizes, int w, int h) { final double ASPECT_TOLERANCE = 0.1; double targetRatio = (double) w / h; …
Ram Patra
  • 16,266
  • 13
  • 66
  • 81
5
votes
2 answers

WakefulIntentService implementation clarifications

Commonsware's WakefulIntentService works beautifully but there are some things I do not quite get. Below is the core of the service - a stripped down version of the source : class WIS extends IntentService { private static final String NAME =…
Mr_and_Mrs_D
  • 32,208
  • 39
  • 178
  • 361
5
votes
3 answers

Dynamically Add and Remove Fragments From FragmentPagerAdapter

I have a FragmentPagerAdapter for a viewPager Which initially has only one Fragment in it. I want to dynamically add a new Fragment to the adapter when user swipes from right to left, and dynamically remove a Fragment when user swipes from left to…
dora
  • 2,047
  • 3
  • 18
  • 20
5
votes
1 answer

Loader framework vs plain AsyncTask

In my application I need a lot of CRUD stuffs: read records from the local SQLite database, insert objects and updating stuffs. Most of the queries are so simple that they won't block even if run on the UI thread, however in this application I want…
Raffaele
  • 20,627
  • 6
  • 47
  • 86
5
votes
3 answers

Endless Gridview

I have looked at lots of implementations of endless lists. One of them is https://github.com/commonsguy/cwac-endless All of them are using listviews. And all of them are simply adding another row to the list. But when we consider Gridview (like in…
tasomaniac
  • 10,234
  • 6
  • 52
  • 84
4
votes
1 answer

Getting SQLiteCursorLoader to observe data changes

I'm trying to implement a DataListFragment with an adapter that uses a Loader from Commonsware. This Loader uses a SQLiteDatabase directly and doesn't require the use of ContentProviders. The android reference states about Loaders: "While Loaders…
CjS
  • 2,037
  • 2
  • 21
  • 29
4
votes
4 answers

Remove view from MergeAdapter

Is it possible to remove view or adapter from MergeAdapter somehow? I'd try to extend it and remove the view from pieces but it's private. Or maybe there's an alternative solution to show/hide view in this adapter? I tried to set its layout_height…
ernazm
  • 9,208
  • 4
  • 44
  • 51
1
2 3
26 27