Permalink
Browse files

no longer crashes when adding a widget.

But the config screen doesn't show up again, will work on that next...
  • Loading branch information...
1 parent 67229bd commit 39a42886424fe10fa24a36fb5809c1c64a7b8c8e @gregkh committed Jun 10, 2010
Showing with 9 additions and 9 deletions.
  1. +9 −9 src/com/kroah/clock/Configure.java
View
18 src/com/kroah/clock/Configure.java
@@ -79,15 +79,15 @@ public void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.config);
// Find the widget id from the intent.
-// Intent intent = getIntent();
-// Bundle extras = intent.getExtras();
-// if (extras != null) {
-// mAppWidgetId = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID);
-// }
-// // If they gave us an intent without the widget id, get out
-// if (mAppWidgetId == AppWidgetManager.INVALID_APPWIDGET_ID) {
-// finish();
-// }
+ Intent intent = getIntent();
+ Bundle extras = intent.getExtras();
+ if (extras != null) {
+ mAppWidgetId = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID);
+ }
+ // If they gave us an intent without the widget id, get out
+ if (mAppWidgetId == AppWidgetManager.INVALID_APPWIDGET_ID) {
+ finish();
+ }
okButton = (Button)findViewById(R.id.myButton);
okButton.setOnClickListener(new View.OnClickListener() {

0 comments on commit 39a4288

Please sign in to comment.