Remove All Ads from XDA

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

1 posts
Thanks Meter: 0
By nefastudio, Junior Member on 17th February 2014, 06:09 AM
Post Reply Email Thread
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?

public class samplecode extends Activity {
	AppWidgetHost appWidgetHost;

	protected void onCreate(Bundle 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);
Post Reply Subscribe to Thread

coding, widget

Guest Quick Reply (no urls or BBcode)
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes