AndroidManifest.xml
xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.android.xxxx">
<application android:persistent="true"
android:label="@string/home_title"
android:icon="@drawable/ic_launcher_home">
<activity android:name="xxxxxxxx"
android:theme="@android:style/Theme.Translucent">
<intent-filter>
<action android:name="android.intent.action.LAUCHER" />
<category android:name="android.intent.category.DEFAULT" />
intent-filter>
activity>
application>
manifest>
xxxxxxxx.java
package com.example.android.xxxx;
public class fpToolbar extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
LinearLayout layout2;
layout2 = new LinearLayout(this);
Button b = new Button(this);
Button b2 = new Button(this);
layout2.addView(b);
layout2.addView(b2);
layout2.setGravity(Gravity.BOTTOM | Gravity.LEFT);
layout2.setBackgroundDrawable(null); /* 设置成透明,必须在AndroidManifest.xml中设置android:theme="@android:style/Theme.Translucent" */
b.setText("test pop.");
b2.setText("hello!");
setContentView(layout2);
}
}