Launching a dialog from preferences?

by jsdf » Sun, 08 Mar 2009 07:41:38 GMT


Sponsored Links
 Hi,
Is there a way to launch a dialog (say, the dialog I show to users the
first time they launch the app) from a preferences entry?

I don't see any examples doing this in the API Demos, nor have I seen
it out in the wild.

I do see a class called DialogPreference, but this doesn't seem to be
what I want.

Thanks.
--~--~---------~--~----~------------~-------~--~----~



Launching a dialog from preferences?

by Mark Murphy » Sun, 08 Mar 2009 07:57:41 GMT


 


If you just need it from the preferences activity, you could always put
it as an option menu choice.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com 

Android Training on the Ranch! -- Mar 16-20, 2009
 http://www.bignerdranch.com/schedule.shtml 

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Launching a dialog from preferences?

by Stoyan Damov » Mon, 09 Mar 2009 07:07:41 GMT


 Search this list for SeekBarPreference. Marc Tan (thanks again Marc)
shared an example of a DialogPreference subclass which displays a seek
bar. You can use it as a starting point to create your own dialog and
stick whatever you need in it.

Cheers




--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. WTKHT : Cara Wipe All Data Di Motorola Droid 1

Thanks Master Iwan...sudah ada clockworkmod recovery

Tapi adanya :
Wipe data/factory reset
Wipe cache partition

Trus ada pilihan Advance waktu saya click, ada :
Wipe dalvik cache
Wipe battery stats

Apa semua wipe harus dilakukan?

Thanks in advanve


ke
diwipe
agar

-- 
===============

2. LocationManager.requestSingleUpdate() crashes device

I got nowhere with my previous question, so I did some experimenting
and am trying again. The following code is correct AFAIK, but reliably
crashes the emulator with a SIGSEGV. The build target is 2.3.1.

public class LocationUpdateDemoActivity extends Activity
{
        private static final String NEW_SINGLE =
"com.androidbook.location.NEW_SINGLE";
        LocationManager locMgr = null;
        private BroadcastReceiver receiver;
        private PendingIntent pIntent;

    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);

        locMgr = (LocationManager)
getSystemService(Context.LOCATION_SERVICE);
    }

    @Override
    public void onResume() {
        super.onResume();
        pIntent = PendingIntent.getBroadcast(this,
            0,
            new Intent(NEW_SINGLE),
            PendingIntent.FLAG_UPDATE_CURRENT);

        IntentFilter iFilter = new IntentFilter(NEW_SINGLE);
        receiver = new BroadcastReceiver() {
                        @Override
                        public void onReceive(Context context, Intent intent) {
                                Log.v("receiver", "Got intent: " + 
intent.getAction());
                        }
        };
        this.registerReceiver(receiver, iFilter);

        locMgr.requestSingleUpdate(
            LocationManager.GPS_PROVIDER,
            pIntent);
    }

    @Override
    public void onPause() {
        super.onPause();
        locMgr.removeUpdates(pIntent);
        this.unregisterReceiver(receiver);
    }
}

The app starts up okay, displaying a black screen with the proper
title. I then go to the Emulator Control panel in DDMS and click the
Send button for the default GPS coordinates. LogCat then reports the
following, after which all apps die and the emulator starts to reboot
(it gets stuck restarting):

01-31 02:17:08.579: INFO/DEBUG(31): Build fingerprint: 'generic/sdk/
generic:2.3.1/GSI11/93351:eng/test-keys'
01-31 02:17:08.604: INFO/DEBUG(31): pid: 75, tid: 209  >>>
system_server <<<
01-31 02:17:08.626: INFO/DEBUG(31): signal 11 (SIGSEGV), code 1
(SEGV_MAPERR), fault addr 00000000
01-31 02:17:08.640: INFO/DEBUG(31):  r0 00000000  r1 407a3b20  r2
41adfcbc  r3 46528c74
01-31 02:17:08.650: INFO/DEBUG(31):  r4 0000012d  r5 00000000  r6
407a3b20  r7 41adfcbc
01-31 02:17:08.650: INFO/DEBUG(31):  r8 84301321  r9 84302240  10
00100000  fp 00000001
01-31 02:17:08.669: INFO/DEBUG(31):  ip 82f0e7d4  sp 46528c60  lr
82f0ab37  pc 82f07d0e  cpsr 00000030
01-31 02:17:09.630: INFO/DEBUG(31):          #00  pc 00007d0e  /system/
lib/libandroid_servers.so
01-31 02:17:09.630: INFO/DEBUG(31):          #01  pc 0000ab32  /system/
lib/libandroid_servers.so
01-31 02:17:09.660: INFO/DEBUG(31):          #02  pc 000012ca  /system/
lib/hw/gps.goldfish.so
01-31 02:17:09.692: INFO/DEBUG(31):          #03  pc 000014ae  /system/
lib/hw/gps.goldfish.so
01-31 02:17:09.692: INFO/DEBUG(31):          #04  pc 00011a7c  /system/
lib/libc.so
01-31 02:17:09.720: INFO/DEBUG(31):          #05  pc 00011640  /system/
lib/libc.so
01-31 02:17:09.730: INFO/DEBUG(31): code around pc:
01-31 02:17:09.751: INFO/DEBUG(31): 82f07cec ab04b082 9301cb04
6f646804 b00247a0
01-31 02:17:09.751: INFO/DEBUG(31): 82f07cfc bc08bc10 4718b002
b510b40c ab04b082
01-31 02:17:09.751: INFO/DEBUG(31): 82f07d0c 6804cb04 34f89301
47a06824 bc10b002
01-31 02:17:09.751: INFO/DEBUG(31): 82f07d1c b002bc08 46c04718
b510b40c ab04b082
01-31 02:17:09.751: INFO/DEBUG(31): 82f07d2c 9301cb04 34986804
47a06824 bc10b002
01-31 02:17:09.792: INFO/DEBUG(31): code around lr:
01-31 02:17:09.792: INFO/DEBUG(31): 82f0ab14 91099008 f7fb6aa0
900aeb14 1c3a910b
01-31 02:17:09.792: INFO/DEBUG(31): 82f0ab24 6b646b23 930c1c28
1c31940d f7fd9b0f
01-31 02:17:09.792: INFO/DEBUG(31): 82f0ab34 4906f8e7 44791c28
f7ff3150 b011fe1d
01-31 02:17:09.792: INFO/DEBUG(31): 82f0ab44 46c0bdf0 0000454c
000042c8 00000786
01-31 02:17:09.792: INFO/DEBUG(31): 82f0ab54 f7fbb510 bd10ec7c
4802b510 f7fb4478
01-31 02:17:09.792: INFO/DEBUG(31): stack:
01-31 02:17:09.792: INFO/DEBUG(31):     46528c20  d97f62b7
01-31 02:17:09.792: INFO/DEBUG(31):     46528c24  40c7d685
01-31 02:17:09.792: INFO/DEBUG(31):     46528c28  0000000a
01-31 02:17:09.799: INFO/DEBUG(31):     46528c2c  00000000
01-31 02:17:09.799: INFO/DEBUG(31):     46528c30  0000ab90  [heap]
01-31 02:17:09.799: INFO/DEBUG(31):     46528c34  81d48bd3  /system/
lib/libdvm.so
01-31 02:17:09.799: INFO/DEBUG(31):     46528c38  0000ab90  [heap]
01-31 02:17:09.799: INFO/DEBUG(31):     46528c3c  46528c6c
01-31 02:17:09.799: INFO/DEBUG(31):     46528c40  00010004  [heap]
01-31 02:17:09.809: INFO/DEBUG(31):     46528c44  81d3761b  /system/
lib/libdvm.so
01-31 02:17:09.809: INFO/DEBUG(31):     46528c48  00000000
01-31 02:17:09.809: INFO/DEBUG(31):     46528c4c  afd0dcc4  /system/
lib/libc.so
01-31 02:17:09.809: INFO/DEBUG(31):     46528c50  00000000
01-31 02:17:09.809: INFO/DEBUG(31):     46528c54  46528e00
01-31 02:17:09.809: INFO/DEBUG(31):     46528c58  df002777
01-31 02:17:09.809: INFO/DEBUG(31):     46528c5c  e3a070ad
01-31 02:17:09.809: INFO/DEBUG(31): #00 46528c60  00000001
01-31 02:17:09.809: INFO/DEBUG(31):     46528c64  8053bf25  /system/
lib/libandroid_runtime.so
01-31 02:17:09.809: INFO/DEBUG(31):     46528c68  0000012d
01-31 02:17:09.860: INFO/DEBUG(31):     46528c6c  82f0ab37  /system/
lib/libandroid_servers.so
01-31 02:17:09.860: INFO/DEBUG(31):     46528c70  41adfcbc  /dev/
ashmem/dalvik-LinearAlloc (deleted)
01-31 02:17:09.860: INFO/DEBUG(31):     46528c74  00000003
01-31 02:17:09.891: INFO/DEBUG(31): #01 46528c78  4284dfce  /data/
dalvik-cache/system@framew...@framework.jar@classes.dex
01-31 02:17:09.891: INFO/DEBUG(31):     46528c7c  4042b604  /dev/
ashmem/dalvik-heap (deleted)
01-31 02:17:09.891: INFO/DEBUG(31):     46528c80  cffeb075
01-31 02:17:09.891: INFO/DEBUG(31):     46528c84  c05e8561
01-31 02:17:09.891: INFO/DEBUG(31):     46528c88  00000000
01-31 02:17:09.891: INFO/DEBUG(31):     46528c8c  00000000
01-31 02:17:09.939: INFO/DEBUG(31):     46528c90  00000000
01-31 02:17:09.939: INFO/DEBUG(31):     46528c94  00000000
01-31 02:17:09.939: INFO/DEBUG(31):     46528c98  00000000
01-31 02:17:09.939: INFO/DEBUG(31):     46528c9c  00000000
01-31 02:17:09.939: INFO/DEBUG(31):     46528ca0  00000000
01-31 02:17:09.939: INFO/DEBUG(31):     46528ca4  00000000
01-31 02:17:09.939: INFO/DEBUG(31):     46528ca8  d95e6c00
01-31 02:17:09.969: INFO/DEBUG(31):     46528cac  0000012d
01-31 02:17:09.969: INFO/DEBUG(31):     46528cb0  46528e56
01-31 02:17:09.969: INFO/DEBUG(31):     46528cb4  00000003
01-31 02:17:09.969: INFO/DEBUG(31):     46528cb8  0000000a
01-31 02:17:09.969: INFO/DEBUG(31):     46528cbc  46528de8
01-31 02:17:09.969: INFO/DEBUG(31):     46528cc0  00000000
01-31 02:17:09.969: INFO/DEBUG(31):     46528cc4  46528e6c
01-31 02:17:09.969: INFO/DEBUG(31):     46528cc8  00000001
01-31 02:17:10.000: INFO/DEBUG(31):     46528ccc  843012cd  /system/
lib/hw/gps.goldfish.so
01-31 02:17:43.249: DEBUG/Zygote(33): Process 75 terminated by signal
(11)
01-31 02:17:43.249: INFO/Zygote(33): Exit zygote because system server
(75) has terminated
01-31 02:17:43.340: INFO/ServiceManager(28): service 'usagestats' died
01-31 02:17:43.340: INFO/ServiceManager(28): service 'audio' died

Any ideas here? The documentation on this method appears to be
completely unrelated to what I would expect, and what I'm actually
seeing. My guess is that the GPS data is supposed to be added to the
Intent in extras, but this isn't clear from the description. It the
location or status information is being added as data, then my intent
filter won't match and maybe the device dies because of that
disconnect. Help please?

- dave

On Dec 26 2010, 3:31am, farble1670 <jeffrey.blatt...@gmail.com>





-- 

3. Looking for 50-50 partner - Using unity3d

4. "Share app" button? Any direct way to send link to launch market to app location?

5. How to change the background color of ToggleButton?

6. Salam ...

7. ARM toolchain