Mac Systems
- Forum-Beiträge: 1.727
27.04.2010, 12:33:37 via Website
27.04.2010 12:33:37 via Website
Hallo,
so langsam aber sicher verliere ich die Geduld bei dieser doch recht simplen Sache. Sobald ich einen Dialog
erzeuge und diese mittels Activity#showDialog(NR) erzeuge bekomme ich eine Logcat Meldung in dieser Art
drücke ich im Emulator CTRL+F11 (Screen Orientation)
Hat jemand ein Bsp wie das umzusetzen ist ?
Auch habe Ich versuche das ganze mittels Dialog#setOwnerActivity(Context) zu lösen, auch hier kein Erfolg.
Das Problem tritt mit 1.5 sowie mit dem 2.01 SDK auf.
Danke,
Mac
so langsam aber sicher verliere ich die Geduld bei dieser doch recht simplen Sache. Sobald ich einen Dialog
erzeuge und diese mittels Activity#showDialog(NR) erzeuge bekomme ich eine Logcat Meldung in dieser Art
drücke ich im Emulator CTRL+F11 (Screen Orientation)
04-27 12:22:30.373: ERROR/WindowManager(719): Activity de.macsystems.TestActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@435d6428 that was originally added here
Hat jemand ein Bsp wie das umzusetzen ist ?
1protected void onCreate(final Bundle savedInstanceState)
2 {
3 ....
4
5 showDialog(UPDATE_SPOT_DIALOG);
6
7 }
8
9 private Dialog createUpdateProgressDialog()
10 {
11 if (Logging.isLoggingEnabled())
12 {
13 Log.d(LOG_TAG, "createUpdateProgressDialog");
14 }
15 final ProgressDialog dialog = new ProgressDialog(this);
16 dialog.setTitle("Updating");
17 dialog.setCancelable(true);
18 dialog.setButton(ProgressDialog.BUTTON_NEGATIVE, getString(android.R.string.cancel), new OnClickListener()
19 {
20 @Override
21 public void onClick(final DialogInterface _dialog, int _which)
22 {
23 System.out.println("Cancel clicked");
24 removeDialog(UPDATE_SPOT_DIALOG);
25 }
26 });
27// dialog.setOwnerActivity(this);
28 return dialog;
29 }
30
31 /*
32 * (non-Javadoc)
33 *
34 * @see android.app.Activity#onCreateDialog(int)
35 */
36 @Override
37 protected Dialog onCreateDialog(int _id)
38 {
39 if (Logging.isLoggingEnabled())
40 {
41 Log.d(LOG_TAG, "onCreateDialog :" + _id);
42 }
43 Dialog dialog;
44 switch (_id)
45 {
46 case (UPDATE_SPOT_DIALOG):
47 dialog = createUpdateProgressDialog();
48 break;
49 default:
50 dialog = null;
51 break;
52 }
53
54 return dialog;
55 }
Es gibt zwar zig Blogs/Posts dazu aber auch hier nur Vermutungen.2 {
3 ....
4
5 showDialog(UPDATE_SPOT_DIALOG);
6
7 }
8
9 private Dialog createUpdateProgressDialog()
10 {
11 if (Logging.isLoggingEnabled())
12 {
13 Log.d(LOG_TAG, "createUpdateProgressDialog");
14 }
15 final ProgressDialog dialog = new ProgressDialog(this);
16 dialog.setTitle("Updating");
17 dialog.setCancelable(true);
18 dialog.setButton(ProgressDialog.BUTTON_NEGATIVE, getString(android.R.string.cancel), new OnClickListener()
19 {
20 @Override
21 public void onClick(final DialogInterface _dialog, int _which)
22 {
23 System.out.println("Cancel clicked");
24 removeDialog(UPDATE_SPOT_DIALOG);
25 }
26 });
27// dialog.setOwnerActivity(this);
28 return dialog;
29 }
30
31 /*
32 * (non-Javadoc)
33 *
34 * @see android.app.Activity#onCreateDialog(int)
35 */
36 @Override
37 protected Dialog onCreateDialog(int _id)
38 {
39 if (Logging.isLoggingEnabled())
40 {
41 Log.d(LOG_TAG, "onCreateDialog :" + _id);
42 }
43 Dialog dialog;
44 switch (_id)
45 {
46 case (UPDATE_SPOT_DIALOG):
47 dialog = createUpdateProgressDialog();
48 break;
49 default:
50 dialog = null;
51 break;
52 }
53
54 return dialog;
55 }
Auch habe Ich versuche das ganze mittels Dialog#setOwnerActivity(Context) zu lösen, auch hier kein Erfolg.
Das Problem tritt mit 1.5 sowie mit dem 2.01 SDK auf.
Danke,
Mac
Windmate HD, See you @ IO 14 , Worked on Wundercar, Glass V3, LG G Watch, Moto 360, Android TV
Empfohlener redaktioneller Inhalt
Mit Deiner Zustimmung wird hier ein externer Inhalt geladen.
Mit Klick auf den oben stehenden Button erklärst Du Dich damit einverstanden, dass Dir externe Inhalte angezeigt werden dürfen. Dabei können personenbezogene Daten an Drittanbieter übermittelt werden. Mehr Infos dazu findest Du in unserer Datenschutzerklärung.