vendredi 15 mai 2015

is it possible to show a listview in a widget ? and how do i take a custom layout in a widget?

I am trying to make an app which will be a home screen widget showing a list. I am using a widget instead of activity . Then i want to show a list view in that widget. And i also want to show a custom layout in that list view .

Actually i want to create a note Book app as a home screen widget . The list view in that widget will show list of note . the list item will be made by a custom layout . So is it possible to make the list view in a widget ?

public class NewAppWidget extends AppWidgetProvider {

ListView listView;
DBhelper dBhelper;
Button addButton;

ArrayList<NoteHolder> alContacts =  new ArrayList<>();

@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
    // There may be multiple widgets active, so update all of them
    final int N = appWidgetIds.length;
    for (int i = 0; i < N; i++) {
        updateAppWidget(context, appWidgetManager, appWidgetIds[i]);
    }

}

Aucun commentaire:

Enregistrer un commentaire