How to insert image?

by Pierre » Mon, 21 Apr 2008 08:54:29 GMT


Sponsored Links
 Hi, all

I want to design an interface which can input text and insert image.
But I don't know how to insert an existed image. Which class should I
use?

Anyone can heip me?

Thanks
Pierre
--~--~---------~--~----~------------~-------~--~----~



How to insert image?

by Gibson » Mon, 21 Apr 2008 09:09:24 GMT


 Well. Maybe you can using ImageView i think. There are lots of demo in
ApiDemo application. You can try it. Good luck.



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


Sponsored Links


How to insert image?

by Pierre » Mon, 21 Apr 2008 09:31:18 GMT


 Thank you, Gibson! I'll go to see the demo.




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



Other Threads

1. Dynamically loading a .jar file at Runtime

Hi all,

  I am storing the required test.jar file in the /sdcard. I want to
load it dynamically at runtime and want to execute a function xyz()
resides in that. For this purpose

  I had written following code ,

But got ClassCastException : dalvik.system.PathClassLoader

Following is my code ,

import java.io.File;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;

public class Collabera extends Activity {
    /** Called when the activity is first created. */

        private static final Class[] parameters = new Class[] { URL.class };

         public static void loadURLClass(String classPathURL) throws
IOException {

          File f = new File(classPathURL);
          URL url = f.toURL();

          URLClassLoader systemLoader = (URLClassLoader) ClassLoader
            .getSystemClassLoader();
          Class systemLoaderClass = URLClassLoader.class;
          try {
           Method method = systemLoaderClass.getDeclaredMethod("addURL",
             parameters);
           method.setAccessible(true);
           method.invoke(systemLoader, new Object[] { url });
          } catch (Throwable t) {
           t.printStackTrace();
           throw new IOException(
             "Error, could not add URL to system classloader");
          }
         }

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

       setContentView(R.layout.main);

       Log.i("See","**************Before Loading Class
Path**************");
     try {
      Class.forName("test.Test1");
     } catch (ClassNotFoundException e) {
      System.out.println(" Test Class Not Found ....");
     }

     Log.i("See","**************After Loading Class
Path**************");

     try {
      loadURLClass("//sdcard//test.jar");
      Class c = Class.forName("test.Test1");
      Log.i("See"," Test Class Found ....");

      Method method = c.getMethod("xyz", null);

      Object o = c.newInstance();
      String s = (String) method.invoke(o);
      Log.i("See","Got method: " + s);
     } catch (ClassNotFoundException e) {
      System.out.println(" Test Class Not Found ....");
     } catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
        }     }
}


Please help. Thanks in advance.

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

2. When another activity is called from main activity, The calling activity get destroyed?

http://developer.android.com/guide/topics/fundamentals.html




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

3. android on omap 35x evm

4. Understand Broadcast and Intent with Dalvik process

5. Changing drawing order while animating

6. need help on "--core-library"

7. Marquee Api demo