本文實例講述了android實現Splash閃屏效果的方法。分享給大家供大家參考,具體如下:
Java代碼:
public class Splash extends Activity{ private final int SPLASH_DISPLAY_LENGHT = 1000; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.splash); new Handler().postDelayed(new Runnable(){ @Override public void run() { // TODO Auto-generated method stub Intent mainIntent = new Intent(Splash.this, Application.class); Splash.this.startActivity(mainIntent); Splash.this.finish(); } }, SPLASH_DISPLAY_LENGHT); }}AndroidManifest.xml
Xml代碼:
<application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".Application" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.DEFAULT" /> <category android:name="ndroid.intent.category.VIEW" /> </intent-filter> </activity> <activity android:name="Splash" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity></application>
PS:這里再為大家提供一個關于AndroidManifest.xml權限控制的在線查詢工具:
Android Manifest功能與權限描述大全:
http://tools.VeVB.COm/table/AndroidManifest
更多關于Android相關內容感興趣的讀者可查看本站專題:《Android編程之activity操作技巧總結》、《Android視圖View技巧總結》、《Android操作SQLite數據庫技巧總結》、《Android操作json格式數據技巧總結》、《Android數據庫操作技巧總結》、《Android文件操作技巧匯總》、《Android編程開發之SD卡操作方法匯總》、《Android開發入門與進階教程》、《Android資源操作技巧匯總》及《Android控件用法總結》
希望本文所述對大家Android程序設計有所幫助。
新聞熱點
疑難解答