[Q] Widget pick code not working only on LG G2

Search This thread

nefastudio

New member
Dec 6, 2008
1
0
Sorry if I'm at wrong place to ask, I couldn't find other place I can ask this question.

There's a simple code that brings up widget list to let user select widget, and code looks like below.
This works fine on other devices, but causes error only with LG G2 with KitKat (Message "Unfortunately, xxxx has stopped").
It works fine with android SDK KitKat emulator and Nexus 7 with KitKat, so I belive it's not KitKat issue, but something with KitKat rom for LG G2.

This was reported by user of my app, and since I don't have actual device, I can't get stack trace, etc.
Any idea why this simple code does not work on LG G2 / KitKat?

Code:
public class samplecode extends Activity {
	AppWidgetHost appWidgetHost;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		...
		appWidgetHost = new AppWidgetHost(this, 3322);
	}

	public void onClickAddwidget(View view){
		int appWidgetId = appWidgetHost.allocateAppWidgetId();
		Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_PICK);
		intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
		startActivityForResult(intent, REQUEST_CODE_ADD_APPWIDGET);
	}