• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Search results

  1. S

    Apps ListView Bug in Emulator?

    When I populate a ListView in the emulator, it seems fine until it reaches enough items to require scrolling. After that, it starts to repeat items and place them in any old order instead of in the order they appear in the ArrayAdapter. Just wondering if anyone has come across this - if I use...
  2. S

    Apps Add Button to SurfaceView

    Is there any way to add a button to a SurfaceView? Ie: I have a class which extends SurfaceView, and I was hoping in my draw routine I could do something like Button button = new Button(getContext()); button.draw(myCanvas); I've tried various things like this, but although I get no errors...
  3. S

    Apps Ensure code runs after Activity is made visible?

    Hi All I have an activity (hi score table) which makes a web call and displays the retrieved data. It's called using an intent from within an already running activity. The problem I have is to make the activity display first..and then trigger the web call, so that I can show a loading symbol...
  4. S

    Apps Re-using Paint objects?

    Will it really slow things down if I use one text paint to draw 3 different lines of text in a repeating draw routine in different colors like this... textPaint.setARGB(255,255,255,255); c.drawText("HELLO",0,0,textPaint); textPaint.setARGB(255,255,0,0); c.drawText("This is some more...
  5. S

    Apps Activity vs Layout

    I couldn't find any discussion about this anywhere. Just wondering what the 'best practice is'. I am making a little game - it has 4 pretty standard screens 1. Main menu 2. Game screen 3. Help screen 4. Hi scores screen So my question is - which is the best approach. 1. Make each screen a...
  6. S

    Apps Referencing Resource Via String

    I was just wondering if there is any way to reference a resource using a string. Say you had 10 images in your drawable folder called 'img1' 'img2' 'img3' etc...... int imgNum = 2; String imgName = "img"+imgNum; Drawable d = (Drawable) getResources().getDrawable(R.drawable.imgName); Is there...
  7. S

    Apps Animated Sprite Using XML?

    Hi all The Android docs shows a way to create an XML definition of an animation like this: <animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="false"> <item android:drawable="@drawable/img1" android:duration="200" /> <item...