- public class Main extends Activity {
-
- private LayoutInflater m_flater = null;
- private LinearLayout mFlash;
-
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.flash);
- mFlash = (LinearLayout) findViewById(R.id.mFlash);
- mFlash.startAnimation(AnimationUtils
- .loadAnimation(this, R.anim.fadeout));
- m_flater = getLayoutInflater();
- LoadMainTask task = new LoadMainTask(this);
- task.execute("");
-
- }
-
- public View LoadMainView(LayoutInflater flater) {
- View view = flater.inflate(R.layout.main, null);
- Button btnOk = (Button) view.findViewById(R.id.BtnOk);
- btnOk.setOnClickListener(new OnClickListener() {
- public void onClick(View v) {
- finish();
- }
- });
- return view;
- }
-
- private class LoadMainTask extends AsyncTask<Object, Object, View> {
- public LoadMainTask(Context context) {
- }
-
- protected View doInBackground(Object... params) {
- View view = null;
- view = LoadMainView(m_flater);
-
- try {
- Thread.sleep(3000);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- return view;
- }
-
-
- protected void onPostExecute(View view) {
- setContentView(view);
- }
- }
-
- }
posted on
2011-04-15 09:38
kitea
阅读(
137)
评论()
收藏
举报