MediaPlayer not running - just blank screen

by dillirao malipeddi » Thu, 05 Mar 2009 17:48:12 GMT


Sponsored Links
 id you get any error in ddms logcat ?
may be your player gives error while try to play



On Thu, Mar 5, 2009 at 3:14 PM, nithin <nithin.war...@gmail.com> wrote:



--
Dilli Rao. M

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



MediaPlayer not running - just blank screen

by Marco Nelissen » Fri, 06 Mar 2009 01:03:06 GMT


 hat won't work for a number of reasons:
- when you create the MediaPlayer and call start(), your display isn't
ready yet. You need to wait for the surfaceCreated() callback.
- you need to use the version of MediaPlayer.create() that takes a
SurfaceHolder parameter.
(this was all discussed on this mailing list a few weeks ago, you
might want to search the archives)



On Thu, Mar 5, 2009 at 1:44 AM, nithin <nithin.war...@gmail.com> wrote:

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


Sponsored Links


Other Threads

1. Strange behavior Spinner in nested LinearLayouts. Bug or Feature?

Hello android enthusiasts,

I noticed a pretty strange behavior today. It seems as if the number
of executions of an overriden getView() methode (of
SimpleCursorAdapter) is correlated to the number of LinearLayouts (the
Spinner widget that uses this adapter) it is nested in.

The following code illustrates this:

############################
####DemonstrateBug.java#####
############################
public class DemonstrateBug extends Activity {

    @Override
    protected void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        setContentView(R.layout.bug);

        String[] from = new String[] { People.NAME };
        int[] to = { R.id.tv_name };

        Cursor cursor = managedQuery(People.CONTENT_URI, new String[] {
                People._ID, People.NAME }, null, null);

        SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
                R.layout.in_spinner, cursor, from, to) {
            @Override
            public View getView(int position, View convertView, ViewGroup
parent) {
                Log.d("BUG", "getView for posititon " + position);
                return super.getView(position, convertView, parent);
            }
        };

        Spinner s = (Spinner) findViewById(R.id.spinner);
        s.setAdapter(adapter);
        s.setSelection(2);
    }
}

###############################
###res/layout/bug.xml############
###############################
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" android:orientation="vertical">
        <LinearLayout android:layout_width="wrap_content"
                android:layout_height="wrap_content" 
android:orientation="vertical">
                <LinearLayout android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:orientation="vertical">
                        <Spinner android:id="@+id/spinner"
                                android:layout_width="fill_parent"
                                android:layout_height="fill_parent" />
                </LinearLayout>
        </LinearLayout>
</LinearLayout>

Output:
...
D/ActivityThread( 5979): Installing external provider
contacts;call_log:
com.google.android.providers.contacts.ContactsProvider
D/BUG     ( 5979): getView for posititon 0
D/BUG     ( 5979): getView for posititon 0
D/BUG     ( 5979): getView for posititon 2
...

Expected Output:
...
D/ActivityThread( 5979): Installing external provider
contacts;call_log:
com.google.android.providers.contacts.ContactsProvider
(maybe: "D/BUG     ( 5979): getView for posititon 0" because of
initialization)
D/BUG     ( 5979): getView for posititon 2
....

If i nest another LinearLayout arround the Spinner, getView will be
executed 4 times. After that I can nest as many Views as I like,
getView will not be called more than 4 times.

I have 2 problems with the bug:
1) I have a pretty complicated layout and I load and scale an image in
getView. When getView is executed 4 times it takes pretty long
(because the image will be scaled and loaded 4 times).
2) Even if I should not do resource intensive stuff in getView() it
creates side effects because 1 time getView is called for the right
position, the other times it is called for the first item in the
spinner.

I have a similar issue with ListView in a ListActivity. But it is
harder to reproduce. I hope gaining insight in this behavior will
reveal insight in the other one as well.

Can you reproduce said behavior? Should I file a bug report?

Bye bye,
Valentin
--~--~---------~--~----~------------~-------~--~----~

2. Button im map

I want to show my contacts on the map showing their photos. But I want
these images to be clickable.
In other words I want to put a button on a Overlay and make link it to
a webpages.
Is that possible?

Gustavo avila.
androidforum.com.br
--~--~---------~--~----~------------~-------~--~----~

3. Are you satisfied or disappointed with the level of support from Google, for Android?

4. Listening to button events.

5. Call out to the community about the poor quality of Android's error messaging

6. Listview & animation problem

7. What happens when an activity does something in for instance onMenuItemSelected() or any other method and other activity comes up?