Custom component using custom dialog

by Nigel » Wed, 09 Sep 2009 02:15:28 GMT


Sponsored Links
 My application needs to be aware of a custom dialog, which is used
only by a custom component.  By "aware" I mean through the
onCreateDialog and onPrepareDialog.

I would like the dialog to be fully encapsulated by the component, but
if the component performs a:

Dialog d = new CustomDialog(getContext());
d.show();

rather than:

Activity a = (Activity)getContext();
a.showDialog(CustomDialog.ID);

I get an exception - primarily because the dialog's "onCreate(Bundle
b)" method doesn't get automatically called.

I'm looking for opinions on the best way to structure the code...

Comments welcomed.

Thanks,

Nigel

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



Custom component using custom dialog

by Nigel » Thu, 10 Sep 2009 13:35:33 GMT


 In the end I have performed this with the client code making an
explicit call to perform the required initialisation.  This doesn't
feel right, but it works.



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


Sponsored Links


Other Threads

1. beagleboard - rowboat-eclair kernel panic

I need your help.
I got below kernel panic with Rowboat eclair built image.
All build procedure had successfully ended.
But, mmcblk0p2 never be mounted.
Could someone please help me out ?

Jooil

-------------------------------------------------------------
Texas Instruments X-Loader 1.4.2 (Feb 19 2009 - 12:01:24)
Reading boot sector
Loading u-boot.bin from nand


U-Boot 2009.08 (Sep 14 2009 - 13:47:24)

OMAP3530-GP ES3.0, CPU-OPP2 L3-165MHz
OMAP3 Beagle board + LPDDR/NAND
DRAM:  256 MB
NAND:  256 MiB
In:    serial
Out:   serial
Err:   serial
Board revision C
Die ID #5f5000030000000004013f7906006017
Hit any key to stop autoboot:  5 \0x08\0x08\0x08 4 \0x08\0x08\0x08 3
\0x08\0x08\0x08 2 \0x08\0x08\0x08 1 \0x08\0x08\0x08 0
mmc1 is available
reading boot.scr

377 bytes read
Running bootscript from mmc ...
## Executing script at 82000000
reading uImage

2413092 bytes read
***** Kernel: /dev/mmcblk0p1/uImage.bin *****
***** RootFS: /dev/mmcblk0p2 *****
## Booting kernel from Legacy Image at 80200000 ...
   Image Name:   Linux-2.6.32
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2413028 Bytes =  2.3 MB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing
Linux.......................................................................................................................................................
done, booting the kernel.
Linux version 2.6.32 (r...@eepee-desktop) (gcc version 4.4.0 (GCC) ) #1 Tue
Jul 20 18:31:24 KST 2010
CPU: ARMv7 Processor [411fc083] revision 3 (ARMv7), cr=10c53c7f
CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
Machine: OMAP3 Beagle Board
Memory policy: ECC disabled, Data cache writeback
OMAP3430/3530 ES3.0 (l2cache iva sgx neon isp )
SRAM: Mapped pa 0x40200000 to va 0xfe400000 size: 0x100000
Reserving 4194304 bytes SDRAM for VRAM
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 65024
Kernel command line: androidboot.console=ttyS2 console=tty0
console=ttyS2,115200n8 root=/dev/mmcblk0p2 rw init=/init rootwait
omapfb.video_mode=640x480mr...@60
PID hash table entries: 1024 (order: 0, 4096 bytes)
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 128MB 128MB = 256MB total
Memory: 250240KB available (4152K code, 814K data, 172K init, 0K highmem)
Hierarchical RCU implementation.
NR_IRQS:402
Clocking rate (Crystal/Core/MPU): 26.0/332/500 MHz
Reprogramming SDRC clock to 332000000 Hz
GPMC revision 5.0
IRQ: Found an INTC at 0xfa200000 (revision 4.0) with 96 interrupts
Total of 96 interrupts on 1 active controller
OMAP GPIO hardware version 2.5
OMAP clockevent source: GPTIMER12 at 32768 Hz
Console: colour dummy device 80x30
console [tty0] enabled
Calibrating delay loop... 496.77 BogoMIPS (lpj=1937408)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
regulator: core version 0.5
NET: Registered protocol family 16
Found NAND on CS0
Registering NAND on CS0
Unable to get DVI reset GPIO
OMAP DMA hardware revision 4.0
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
i2c_omap i2c_omap.1: bus 1 rev3.12 at 2600 kHz
twl4030: PIH (irq 7) chaining IRQs 368..375
twl4030: power (irq 373) chaining IRQs 376..383
twl4030: gpio (irq 368) chaining IRQs 384..401
regulator: VUSB1V5: 1500 mV normal standby
regulator: VUSB1V8: 1800 mV normal standby
regulator: VUSB3V1: 3100 mV normal standby
twl4030_usb twl4030_usb: Initialized TWL4030 USB module
regulator: VMMC1: 1850 <--> 3150 mV normal standby
regulator: VDAC: 1800 mV normal standby
regulator: VPLL2: 1800 mV normal standby
regulator: VSIM: 1800 <--> 3000 mV normal standby
i2c_omap i2c_omap.2: bus 2 rev3.12 at 400 kHz
i2c_omap i2c_omap.3: bus 3 rev3.12 at 100 kHz
Switching to clocksource 32k_counter
musb_hdrc: version 6.0, musb-dma, otg (peripheral+host), debug=0
musb_hdrc: USB OTG mode controller at fa0ab000 using DMA, IRQ 92
musb_hdrc musb_hdrc: MUSB HDRC host driver
musb_hdrc musb_hdrc: new USB bus registered, assigned bus number 1
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
NET: Registered protocol family 2
IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
TCP established hash table entries: 8192 (order: 4, 65536 bytes)
TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
omap-iommu omap-iommu.0: isp registered
NetWinder Floating Point Emulator V0.97 (double precision)
ashmem: initialized
VFS: Disk quotas dquot_6.5.2
Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
JFFS2 version 2.2. (NAND) \0xc2\0xa9 2001-2006 Red Hat, Inc.
msgmni has been set to 489
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
OMAP DSS rev 2.0
OMAP DISPC rev 3.0
OMAP VENC rev 2
Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
serial8250.0: ttyS0 at MMIO 0x4806a000 (irq = 72) is a ST16654
serial8250.1: ttyS1 at MMIO 0x4806c000 (irq = 73) is a ST16654
serial8250.2: ttyS2 at MMIO 0x49020000 (irq = 74) is a ST16654
console [ttyS2] enabled
brd: module loaded
loop: module loaded
usbcore: registered new interface driver asix
usbcore: registered new interface driver cdc_ether
usbcore: registered new interface driver net1080
usbcore: registered new interface driver cdc_subset
usbcore: registered new interface driver zaurus
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-omap ehci-omap.0: OMAP-EHCI Host Controller
ehci-omap ehci-omap.0: new USB bus registered, assigned bus number 2
ehci-omap ehci-omap.0: irq 77, io mem 0x48064800
ehci-omap ehci-omap.0: USB 2.0 started, EHCI 1.00
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 3 ports detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
android init
f_acm init
android_register_function acm
f_adb init
android_register_function adb
f_mass_storage init
android_register_function usb_mass_storage
f_rndis init
android_register_function rndis
input: gpio-keys as /devices/platform/gpio-keys/input/input0
i2c /dev entries driver
Linux video capture interface: v2.00
omap-iommu omap-iommu.0: isp: version 1.1
OMAP Watchdog Timer Rev 0x31: initial timeout 60 sec
mmci-omap-hs mmci-omap-hs.1: err -16 configuring card detect
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
logger: created 64K log 'log_main'
logger: created 256K log 'log_events'
logger: created 64K log 'log_radio'
logger: created 64K log 'log_system'
Advanced Linux Sound Architecture Driver Version 1.0.21.
usbcore: registered new interface driver snd-usb-audio
No device for DAI omap-mcbsp-dai-0
No device for DAI omap-mcbsp-dai-1
No device for DAI omap-mcbsp-dai-2
No device for DAI omap-mcbsp-dai-3
No device for DAI omap-mcbsp-dai-4
OMAP3 Beagle SoC init
usb 2-2: new high speed USB device using ehci-omap and address 2
asoc: twl4030 <-> omap-mcbsp-dai-0 mapping ok
ALSA device list:
  #0: omap3beagle (twl4030)
TCP cubic registered
NET: Registered protocol family 17
NET: Registered protocol family 15
Power Management for TI OMAP3.
Division by zero in kernel.
[<c0039934>] (unwind_backtrace+0x0/0xd8) from [<c018607c>] (Ldiv0+0x8/0x10)
[<c018607c>] (Ldiv0+0x8/0x10) from [<c0467d7c>] (0xc0467d7c)
Division by zero in kernel.
[<c0039934>] (unwind_backtrace+0x0/0xd8) from [<c018607c>] (Ldiv0+0x8/0x10)
[<c018607c>] (Ldiv0+0x8/0x10) from [<c0467d7c>] (0xc0467d7c)
SmartReflex driver initialized
VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 1
omapdss DPI: Could not find exact pixel clock. Requested 23500 kHz, got
24000 kHz
regulator_init_complete: incomplete constraints, leaving VDVI on
regulator_init_complete: incomplete constraints, leaving VDAC on
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
omapdss DPI error: display already enabled
omap_vout omap_vout: 'dvi' Display already enabled
omapdss DPI error: display already enabled
omap_vout omap_vout: 'dvi' Display already enabled
omap_vout omap_vout: Buffer Size = 3686400
omap_vout omap_vout: : registered and initialized video device 0
omap_vout omap_vout: Buffer Size = 3686400
omap_vout omap_vout: : registered and initialized video device 1
Waiting for root device /dev/mmcblk0p2...
hub 2-2:1.0: USB hub found
hub 2-2:1.0: 4 ports detected
mmc0: new high speed SD card at address b368
mmcblk0: mmc0:b368 SD    1.88 GiB
 mmcblk0: p1 p2
mmcblk0: error -110 sending status comand
mmcblk0: error -110 sending read/write command, response 0x0, card status
0x0
mmcblk0: error -110 transferring data, sector 1975997, nr 2, card status 0x0
end_request: I/O error, dev mmcblk0, sector 1975997
mmcblk0: error -110 sending status comand
mmcblk0: error -110 sending read/write command, response 0x0, card status
0x0
mmcblk0: error -110 transferring data, sector 1975998, nr 1, card status 0x0
end_request: I/O error, dev mmcblk0, sector 1975998
EXT3-fs (mmcblk0p2): error: unable to read superblock
mmcblk0: error -110 sending status comand
mmcblk0: error -110 sending read/write command, response 0x0, card status
0x0
mmcblk0: error -110 transferring data, sector 1975997, nr 2, card status 0x0
end_request: I/O error, dev mmcblk0, sector 1975997
mmcblk0: error -110 sending status comand
mmcblk0: error -110 sending read/write command, response 0x0, card status
0x0
mmcblk0: error -110 transferring data, sector 1975998, nr 1, card status 0x0
end_request: I/O error, dev mmcblk0, sector 1975998
EXT2-fs (mmcblk0p2): error: unable to read superblock
mmcblk0: error -110 sending status comand
mmcblk0: error -110 sending read/write command, response 0x0, card status
0x0
mmcblk0: error -110 transferring data, sector 1975995, nr 1, card status 0x0
end_request: I/O error, dev mmcblk0, sector 1975995
FAT: unable to read boot sector
VFS: Cannot open root device "mmcblk0p2" or unknown-block(179,2)
Please append a correct "root=" boot option; here are the available
partitions:
b300         1981440 mmcblk0 driver: mmcblk
  b301          987966 mmcblk0p1
  b302          987997 mmcblk0p2
Kernel panic - not syncing: VFS: Unable to mount root fs on
unknown-block(179,2)

Env setup are belows
=========================================
OMAP3 beagleboard.org # printenv
bootcmd=if mmc init; then if run loadbootscript; then run bootscript; else
if run loaduimage; then run mmcboot; else run nandboot; fi; fi; else run
nandboot; fi
baudrate=115200
loadaddr=0x82000000
console=ttyS2,115200n8
videomode=1024x...@60,vxres=1024,vyres=768
videospec=omapfb:vram:2M,vram:4M
mmcargs=setenv bootargs console=${console}
video=${videospec},mode:${videomode} root=/dev/mmcblk0p2 rw rootfstype=ext3
rootwait
nandargs=setenv bootargs console=${console}
video=${videospec},mode:${videomode} root=/dev/mtdblock4 rw rootfstype=jffs2
loadbootscript=fatload mmc 0 ${loadaddr} boot.scr
bootscript=echo Running bootscript from mmc ...; source ${loadaddr}
loaduimage=fatload mmc 0 ${loadaddr} uImage
mmcboot=echo Booting from mmc ...; run mmcargs; bootm ${loadaddr}
nandboot=echo Booting from nand ...; run nandargs; nand read ${loadaddr}
280000 400000; bootm ${loadaddr}
dieid#=5f5000030000000004013f7906006017
bootdelay=5
stdin=serial
stdout=serial
stderr=serial

Environment size: 972/131068 bytes
OMAP3 beagleboard.org #

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

2. How to implement transfer APDU/ATR with SIM card by platform interfac

Dears:

I want to implement transfer APDU/ATR with SIM card, could you please tell
me which platform interface and file can support my requirement? as I can't
find it from Froyo.

Many thanks.

-- 
BEST REGARDS!
Fang Shilong

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

3. OpenGL strange Exception: Nexus one upgrade to 2.2 causes app to crash?

4. i want to put my application in front just after incoming call

5. Bluetooth signal strength on Google Nexus One running Android 2.2 (FroYo)

6. how to upgrade the os of g1 mobile

7. Disabling Java formatting in the Eclipse editor