Search Results

Search found 25798 results on 1032 pages for 'android xml'.

Page 272/1032 | < Previous Page | 268 269 270 271 272 273 274 275 276 277 278 279  | Next Page >

  • @Android display /res/viewable in WebView

    - by MikeNereson
    I am throwing HTML to a webview to render. In the HTML I need to load an image that I have in /res/drawable. I have /res/drawable/my_image.png and code such as this: final WebView browser = (WebView) findViewById(R.id.my_webview); String html = new MyHelper(myObject).getHtml(); browser.loadDataWithBaseURL("", html, "text/html", "UTF-8", ""); Where the String html has something like: <html><head> <h1>Here is the image</h1> <img src="my_image.png" /> </head><html> The question is, what should that image src attribute be to refer to the image in /res/drawable ~Thanks

    Read the article

  • Apply an Animation on a Drawable in Android

    - by Casebash
    I am adding a glow animation effect to a logo. So far, I have managed to get the glow image behind the logo, using a LayeredDrawable, but I can't figure out how to animate it. I have found that AlphaAnimation would achieve the desired effect, but unfortunately I can only apply it on Views, not Drawables. How can I achieve this effect?

    Read the article

  • The finest way to store the HardCore Data i android

    - by david
    Hi All! I am working on an application where I have a long listing of different states approximately 20 states and each state consisting of several zones in addition to the weather forcast of each zone eventually. Now the thing is that I have already created the Listing of hardcore data in a list view of all the states. Again I need to add the hardcore data of several zones for each state(min 4 to 5 zones/ state). So , now I am wondering that whether I have to create the separate classes with hardcore names of all the zones in each state or is there any easy way out for doing the same. It would be great if anyone having the idea can tell me. Thanks, david

    Read the article

  • Android Autolink to launch WebView

    - by Jason Kim
    Hi, I'm using autoLink="web" attribute in TextView to launch Browser. However, I want to launch the myActivity with WebView, when I click the links in TextView. Is is possible that catch the click event and invoke startActivity? Thanks in advance, Jason

    Read the article

  • Android Unable to launch the Inbox from a notification

    - by trpsbill
    I have the following code that creates a notification when an SMS message is received by the phone. It displays the notification correctly; however, when the user clicks the notification, nothing happens. It should open up the SMS inbox so the user can view their message. Thanks in advance. mNotificationManager = (NotificationManager) arg0.getSystemService(Context.NOTIFICATION_SERVICE); Uri uri = Uri.parse("content://sms/inbox"); PendingIntent contentIntent = PendingIntent.getActivity(arg0, 0, new Intent(Intent.ACTION_VIEW, uri), Intent.FLAG_ACTIVITY_NEW_TASK); String tickerText = arg0.getString(R.string.newmsg, msgs[i].getMessageBody().toString()); Notification notif = new Notification(R.drawable.icon, tickerText, System.currentTimeMillis()); notif.setLatestEventInfo(arg0, msgs[i].getOriginatingAddress(), msgs[i].getMessageBody().toString(), contentIntent); notif.vibrate = new long[] { 100, 250, 100, 500 }; mNotificationManager.notify(R.string.recv_msg_notif_id, notif);

    Read the article

  • Question about Intent, android

    - by Kaustubh
    I am confused, and need to get my concepts straight. After executing the last statement, which function is called, in MapsActivity? is it onResume? and under which function (onResume()?) should i put getExtra()? Log.i("onMenuAnimate", "Attempting to animate to:"); Intent intent = new Intent(SearchDB.this, MapsActivity.class); intent.putExtra("com.gpsdroid.SearchDB.Lat", nameLatitude.getText()); intent.putExtra("com.gpsdroid.SearchDB.Long", nameLatitude.getText()); SearchDB.this.startActivity(intent);

    Read the article

  • How to add Focuschange Listner to listview in android

    - by jayanthgande
    Hi, I am having a listview in one of my activity.How to set foucs change listner.I tried with following block of code I am not getting result. product_search_list = (ListView) findViewById(R.id.productlist); product_search_list.setOnFocusChangeListener(onproductchangelistener); private OnFocusChangeListener onproductchangelistener = new OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { int index= (int) ((ListView)v).getSelectedItemId(); Log.i("index",""+index); } }; Actually on focus change of list items I want to get index of focused list item and do the necessary operations. Thanks in advance. Regards: Jayanth

    Read the article

  • Application Publisher

    - by mob1lejunkie
    Hi, I am about to finish my Android application. I would like to provide lite version and more complete paid pro version. Unfortunately, Google does not allow Australian developers to sell applications and I don't have any friends in US or UK. Does anyone know of a person/company who would publish my pro application on my behalf? Google search did not bring up any results. Thanks.

    Read the article

  • Emulator problem in Android

    - by AMANDEEP SINGH
    When I launch the emulator I face many problems (Errors):- HttpConnectionApp]emulator-5554 disconnected! Cancelling 'net.paxcel.http.HttpConnectionApp activity launch'! Emulator]emulator: ERROR: the user data image is used by another emulator. aborting Each time I have to re-run it but all in vain. How can I improve this so that I can re-run the application on same AVD?

    Read the article

  • Display an Android Sensors List

    - by Skatephone
    I'm trying to display a list of available sensors but it's like there are not! I was thinking that it was because of the emulator, but i tried it on the phone and the result is the same. private SensorManager mSensorManager; TextView mSensorsTot,mSensorAvailables; ...... public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); // Get the texts fields of the layout and setup to invisible mSensorsTot = (TextView) findViewById(R.id.sensoritot); mSensorAvailables = (TextView) findViewById(R.id.sensoridisponibili); // Get the SensorManager mSensorManager= (SensorManager) getSystemService(SENSOR_SERVICE); // List of Sensors Available List<Sensor> msensorList = mSensorManager.getSensorList(SensorManager.SENSOR_ALL); // Print how may Sensors are there mSensorsTot.setText(msensorList.size()+" "+this.getString(R.string.sensors)+"!"); // Print each Sensor available using sSensList as the String to be printed String sSensList = new String(""); Sensor tmp; int x,i; for (i=0;i<msensorList.size();i++){ tmp = msensorList.get(i); sSensList = " "+sSensList+tmp.getName(); // Add the sensor name to the string of sensors available } // if there are sensors available show the list if (i>0){ sSensList = getString(R.string.sensors)+":"+sSensList; mSensorAvailables.setText(sSensList); } } Thank's Valerio From Italy :)

    Read the article

  • Android OutOfMemoryError - Loading JSON File

    - by jeremynealbrown
    The app I am working on needs to read a JSON file that may be anywhere from 1.5 to 3 MB in size. It seems to have no problem opening the file and converting the data to a string, but when it attempts to convert the string to a JSONArray, OutOfMemoryErrors are thrown. The exceptions look something like this: E/dalvikvm-heap( 5307): Out of memory on a 280-byte allocation. W/dalvikvm( 5307): Exception thrown (Ljava/lang/OutOfMemoryError;) while throwing internal exception (Ljava/lang/OutOfMemoryError;) One strange thing about this is that the crash only occurs every 2nd or 3rd time the app is run, leaving me to believe that the memory consumed by the app is not being garbage collected each time the app closes. Any insight into how I might get around this issue would be greatly appreciated. I am open to the idea of loading the file in chunks, but I'm not quite sure what the best approach is for such a task. Thank you

    Read the article

  • Android: custom view onClickEvent with X & Y locations

    - by Martyn
    Hi, I've got a custom view and I want to get the X and Y coordinates of a user click. I've found that I can only get the coordinates from the onTouchEvent and an onClickEvent won't fire if I have an onTouchEvent. Unfortunately the onTouchEventfires when the user drags the screen as well as clicking. I've tried to differentiate between the two, but I still get the code firing when I'm dragging: public boolean onTouchEvent(MotionEvent event) { int action = event.getAction(); if (action == MotionEvent.ACTION_DOWN) { //fires on drag and click I've had a look at this but as I mentioned above I don't think the solution there will work as I can't get the onClick and the onTouch events working at the same time. Maybe I'm doing something wrong in this respect, is there a normal way of dealing with capturing user input on custom events? Should I be able to use the onClick and onTouch events at the same time? Thanks, Martyn

    Read the article

  • Android Money Input with fixed decimal

    - by miannelle
    How do you create an edittext entry that formats input in money format only? When the user enters 5, I want the input to look like "$0.05" and when they then enter 3, the input should now look like "$0.53" and finally they enter 6 and the input should look like "$5.36".

    Read the article

  • Android SQLite database locale, locking, and version

    - by gdoten
    In some books and online I see these method calls being made after a database is created: db.setLocale(Locale.getDefault()); db.setLockingEnabled(true); db.setVersion(DB_VERSION); Why is this done? As far as I can tell, after creating a new database, the system adds a table named android_metadata with one field named locale and that table has one row with the locale field set to "en_US". Now I assume the column has that value because I am using a U.S. phone, and if I were using a phone from a different region then the locale field would be set appropriately. Can anyone confirm this? I'm guessing that the setLocale method would only be useful in the case that you install a pre-built database onto a phone and then want to change the locale to match the phone's locale. Sound right? The documentation for setLockingEnabled says it defaults to true so there's no need to make that call, right? Lastly, what's with the call to setVersion? I can't find a table that contains this information so I've been assuming that the database file itself stores the version number somewhere. So when I create a database, which requires you to have already specified the version number in the call to the SQLiteOpenHelper constructor, there's no point in calling setVersion. Again, perhaps this method exists for the case of installing a pre-built database to a device and you then wish to change the database's version (though I can't think of when doing this would make sense). Thanks for any insight!

    Read the article

  • Android - Buffering Lag with VideoView

    - by Chris
    I am using VideoView to display a video in my app. The problem is that, once the layout gets created there is lag of almost 10-30 seconds before which the video starts to play. I can see in LogCat that the video is buffering during the lag. Is there a way I can minimize this lag, or tell MediaPlayer to play the video sooner? Thanks Chris

    Read the article

  • View the Task's activity stack

    - by Mic
    Hi There, I just started developing a simple Android application while I'm still learning its platform. I'm using Eclipse IDE with the ADT plugin 0.9.6 and I need to know if it's possible to view the activity stack that is associated with a Task. Is there any way through the DDMS tool or through any other technique? Thanks in advance for your help/advice. Mic

    Read the article

< Previous Page | 268 269 270 271 272 273 274 275 276 277 278 279  | Next Page >