Sending and receiving.

by Erik Hughes » Mon, 22 Feb 2010 15:07:15 GMT


Sponsored Links
 Hello Devs,
I have the problem that even though the activities starts i cannot get
the data back from the filebrowser.java. I am not getting any errors
except the line begining with the *. The error is code is never used
locally. I have also checked the filbrowser and it does give an output
with the code "aDirectory.getAbsolutePath().toString()" so the issue
is somewhere in the transfer. Code is below:

Main.java
[
        //Code + imports above
       public static final int ACTION_PICK_FILE = 0;

       //Code above is outside the method body.

        button = (Button) findViewById(R.id.button);
        button.setOnClickListener(new View.OnClickListener() {
                public void onClick(View arg0) {
                Intent filebintent = new
Intent(arg0.getContext(),Filebrowser.class);
            startActivityForResult(filebintent, ACTION_PICK_FILE);
                }
*        protected void onActivityResult(int requestCode, int
resultCode, Intent filebintent)
        {
             switch(requestCode)
             {
                 case ACTION_PICK_FILE:
                 if (resultCode == RESULT_OK)
                 {
                Bundle bundle = filebintent.getExtras();
                String select1 = bundle.getString("Selected1");
                String path1 = select1.getBytes().toString();
                System.out.println(select1); //Check if there is an
output.
                System.out.println(path1); //Check if there is an
output.
                 }
                 break;
             }
            }
     });
        //Code
]

Filebrowser.java
[
                //Code + imports above
               OnClickListener okButtonListener = new OnClickListener()
{
                    // @Override
                    public void onClick(DialogInterface arg0, int
arg1) {
                           Bundle Data = new Bundle();
                           Data.putString("Selected1",
aDirectory.getAbsolutePath().toString());
                           Intent mainintent = new Intent();
                           mainintent.putExtras(Data);
                           setResult(RESULT_OK, mainintent);
                           finish();
                    }
               };
                //Code
]

Thanks in advance!
/Erik Hughes

--



Other Threads

1. BackupManagerService usage & explain in Framework

Is there any body can explain about
[com.android.server.BackupManagerService] ?

What the role is?, where it is used mainly?

and

where I can find the class
"com.google.android.backup.BackupTransportService"?

-- 

2. Motorola Milestone not showing up in ddms / adb on Mac OS X Snow Leopard

I've connected my (new) Motorola Milestone running Android 2.0 to an
Intel iMac running the latest version of Snow Leopard.

USB Debugging is enabled on the device. However, ddms doesn't see the
device. Running adb devices returns an empty list.

Any ideas how to troubleshoot?

-- 

3. Problem with getLastKnowLocation from the GPS provider

4. Need to re-initialize or kill the acore process silently

5. Content Providers

6. ProgressBar/AnimatedRotateDrawable causing memory leak?

7. flurry android