不给 Activity   setContentView(......);也就是不给他设置布局文件,

public class MainActivity extends Activity {
 
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        System.out.println("MainActivity  OnCreate()....");
        
        System.out.println("准备开启服务");
        Intent intent = new Intent(MainActivity.this,TestService.class);  
        startService(intent);  
    }
}
 

android:theme="@android:style/Theme.NoDisplay"

 

        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
                    android:name=".MainActivity"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.NoDisplay"
            >
           
               
 
               
           

       
 
       
       

   
 

可以Ctrl+左键点进去看看这个主题是怎么写的:

 
   
 

更多相关文章

  1. 如何制作Android手电筒程序
  2. 关于用eclipse开发android经常出现R异常问题
  3. android studio release版本下打印输出日志
  4. android中的ListView的使用方法
  5. android 关闭软键盘
  6. [Android]判断网络连接是否可用
  7. 打不死的小强--双进程守护
  8. android 延时 不用另起线程或timertask
  9. Android判断定位功能是否开启

随机推荐

  1. Android MediaPlayer音乐播放
  2. Android中使用Gson解析JSON数据
  3. Android原生弹框的工具类AlertDialog,Dial
  4. Android zxing change orientation to po
  5. Git 一些关于 Git、Github 的学习资源
  6. 录音11
  7. android requestFocus的使用
  8. Android SyncManager 实现
  9. Android Audio and Video
  10. Android—锁定横屏遇到的问题