I already tried from @iDroid Explorer solution from one of my previous answers. But listview did not appear in the edge panel (PS: I wanted this to be implemented in the galaxy panel).
So, I tried under the code:
private RemoteViews updateWidgetListView(Context arg0, int i) { //which layout to show on widget RemoteViews remoteViews = new RemoteViews(arg0.getPackageName(), R.layout.activity_main_sub); //RemoteViews Service needed to provide adapter for ListView Log.d("fff", "updateWidget: "+ i); Intent svcIntent = new Intent(arg0, MyService.class); //passing app widget id to that RemoteViews Service svcIntent.putExtra("Id", i); Log.d("fff", "receiver:"+appnM); svcIntent.putExtra("appname", appnM); //setting a unique Uri to the intent //don't know its purpose to me right now svcIntent.setData(Uri.parse(svcIntent.toUri(Intent.URI_INTENT_SCHEME))); //setting adapter to listview of the widget remoteViews.setRemoteAdapter(i, R.id.list_icon,svcIntent); // remoteViews.setRemoteAdapter(i, svcIntent); arg0.startService(svcIntent); //setting an empty view in case of no data remoteViews.setEmptyView(R.id.list_icon, R.id.empty_view); Log.d("fff","end of myReceiver"); return remoteViews; }
And in the myService class, I filled in the necessary elements in the list.
I need help from an example: WidgetListView1, which I found from random searches.
source share