範例如下 :
Java 程式碼
public class helloWorld extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView( R.layout.main );
// Tooltip 顯示
Toast.makeText( this
, "Tooltip 提示內容"
, Toast.LENGTH_LONG
).show();
}
}
範例結果 :