how to transfer an action(ex:key press) from an Activity to other Activities

by npak...@gmail.com » Thu, 12 Mar 2009 19:31:56 GMT


Sponsored Links
 Hi all,
When my application is running, a button is pressed.After my
application processes this event, i want to continue to transfer this
event to other applications. Is it possible? If yes, how to do that?
I very appreciate your advices,
Thanks,
NPAK


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



how to transfer an action(ex:key press) from an Activity to other Activities

by Streets Of Boston » Fri, 13 Mar 2009 03:12:52 GMT


 First you should figure out what you really try to accomplish. I don't
know the details of your app, but i guess that your goal is not to
push a button. The goal is the action that occurs when the button is
pushed.

I would just call the action (method/java-code/etc) directly that
would have been called by the button-click of the other activity.



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


Sponsored Links


how to transfer an action(ex:key press) from an Activity to other Activities

by Streets Of Boston » Fri, 13 Mar 2009 10:55:54 GMT


 You could figure how to start the original dialer's activity
(startActivity(Intent)) providing the correct Intent... I'm not sure
how to do that, which action/category/extra-data/etc. to set to make
this happen. Maybe someone else can help you with that.





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



Other Threads

1. MediaPlayer cant play audio files from program data folder ?

Hi all!

When i record my audio from MIC and store file in /data/data/..... why
MediaPlayer can't play this file ? If i change destination to /
sdcard/..... - all works great. I do something wrong ? I not found
limitation for MediaPlayer.  Device - Samsung T959 (Galaxy S)

Thanks, i hope anybody know solution....

-- 

2. Button Mashing Alert Dialog

Hi All

So I have a fairly simple droid app.
Part of it is a waterfall of alertdialog boxes makeing sure everything
is ready to show the final display.

Example
Check GPS
If (no GPS){
alert.show}

The alert has one button that first dismisses the dialog, then
performs the check again, and displays another dialog box if GPS is
still not enabled.

This all works great if I go at a normal pace.
But if I button mash the alert dialog button, eventually I get many
alert dialog buttons on top of each other.

The program still works, ya just gotta close all of them.

Here is some example

    gps_init_alt_bld = new AlertDialog.Builder(this);
    gps_init_alt_bld.setMessage("GPS Not Initialized Yet.")
    .setCancelable(false)
    .setPositiveButton("Check GPS Status Again.", new
DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int id) {
                // Action for 'Yes' Button
                if (latitude == 0 || longitude == 0)
                {
                        gps_initialized=false;

                        gps_init_alert = gps_init_alt_bld.create();
                        // Title for AlertDialog
                        gps_init_alert.setTitle("GPS Is Needed!");
                        // Icon for AlertDialog
                        gps_init_alert.setIcon(R.drawable.icon);
                        try{
                        gps_init_alert.show();
                        }
                        catch(Exception eeee){
                                //Log.d("alert","Could NOTTTT THROW INIT 
ALERT2");
                                }
                }
                else
                {
                        gps_initialized=true;
                        dialog.dismiss();
                        onStart();
                }
        }
    });

gps_init_alert = gps_init_alt_bld.create();
//Title for AlertDialog
gps_init_alert.setTitle("GPS Is Needed!");
//Icon for AlertDialog
gps_init_alert.setIcon(R.drawable.icon);

//Log.d("POSITION", "Staring Check Init");
if (latitude == 0 || longitude == 0)
{
        gps_initialized=false;
        try{
        gps_init_alert.show();
        }
        catch(Exception eeeeee){
                //Log.d("alert","Could NOTTTT THROW INIT ALERT");
                }

}

-- 

3. Custom ViewGroup

4. SMDK6410 android lcd porting

5. 100 ms stuttering(lag) in games.

6. Request: Don't make us use Ant

7. Reliable way to programmatically open options menu on startup