MediaController für Audio in XML

  • Antworten:0
Gelöschter Account
  • Forum-Beiträge: 694

18.10.2012, 17:53:29 via Website

Hallo,

ich versuche jetzt schon seit zwei Tagen den MediaController fest in eine Layout Ressource zu integrieren. Das Layout/die Activity ist eine ListActivity und ich wollte dort am unteren Ende den MediaController fest eingeblendet lassen. Hat das schon mal jemand erfolgreich hinbekommen?

Ich habe auch schon mit einer Subclass von MediaController getestet bei der die hide() Methode abgefangen wird (habe einen Hinweis auf der Developer Seite entsprechend interpretiert). Ich kann machen was ich will der MediaController wird nie angezeigt:

1public class MyMediaController extends MediaController {
2
3 public MyMediaController(Context context) {
4 super(context);
5 }
6
7 public MyMediaController(Context context, AttributeSet attrs) {
8 super(context, attrs);
9 }
10
11 public MyMediaController(Context context, boolean useFastForward) {
12 super(context, useFastForward);
13 }
14
15 @Override
16 public void hide() {
17 // Hide wird abgeschaltet
18 }
19}

1<?xml version="1.0" encoding="utf-8"?>
2<LinearLayout
3 xmlns:android="http://schemas.android.com/apk/res/android"
4 android:id="@+id/layout"
5 android:layout_height="wrap_content"
6 android:layout_width="fill_parent"
7 android:orientation="vertical" >
8
9 <TextView
10 android:text="@string/txt_titlebar"
11 style="@style/ActivityTitleBar" />
12
13 <ListView
14 android:drawSelectorOnTop="false"
15 android:fastScrollEnabled="true"
16 android:id="@id/android:list"
17 android:layout_height="wrap_content"
18 android:layout_width="fill_parent" />
19
20 <TextView
21 android:id="@id/android:empty"
22 android:text="@string/txt_empty"
23 style="@style/TextViewStandard" />
24
25 <xx.yy.zz.MyMediaController
26 android:id="@+id/controller"
27 android:layout_height="wrap_content"
28 android:layout_width="fill_parent" />
29
30</LinearLayout>

Antworten