android - How can't I make the screen flickered? -


i install following app in real mobile phone, hope information displayed when click app icon. find mobile phone screen flicker, seems system create , display ui, destory ui quickly. don't hope screen flicker, how can do? thanks!

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"     package="com.androidbook.telephony" android:versioncode="1"     android:versionname="1.0">     <application android:icon="@drawable/icon" android:label="@string/app_name">         <activity android:name=".telephonydemo" 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>     <uses-sdk android:minsdkversion="4" />     <uses-permission android:name="android.permission.send_sms"/> </manifest>    package com.androidbook.telephony; import android.app.activity; import android.os.bundle; import android.telephony.smsmanager; import android.view.view; import android.widget.toast;  public class telephonydemo extends activity {     @override     protected void oncreate(bundle savedinstancestate) {         super.oncreate(savedinstancestate);         dosend(null);     }     public void dosend(view view) {          try {             sendsmsmessage(                 "12345678","hello");             toast.maketext(this, "sms sent",                      toast.length_long).show();         } catch (exception e) {             toast.maketext(this, "failed send sms",                      toast.length_long).show();             e.printstacktrace();         }     }      @override     protected void ondestroy() {         super.ondestroy();     }      private void sendsmsmessage(string address,string message)throws exception     {         smsmanager smsmgr = smsmanager.getdefault();         smsmgr.sendtextmessage(address, null, message, null, null);         finish();     } } 

its flickering because default activity has ui, , drawing yours (since aren't setting any, using either pure white or pure black). add android:theme="@android:style/theme.nodisplay" manifest, won't try draw anything


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -