就是点击一下程序的图标,执行一些代码,并不显示任何界面。
那么怎么实现这种需求呢,代码入口在哪儿?

解决方案 »

  1.   

    这个貌似不行吧……android的开发本身就是可视化的吧。
      

  2.   

    android 有这样的“接口”
      

  3.   


    首先你 新建项目的时候不要选Create Activity 然后用广播获取 系统启动广播 在开启 Service
    不过点击图标这个倒是没想过
      

  4.   

    楼主 你可以做一个activity 就现实一个dialog 
    我给你写个简单的布局文件
    AndroidManifest.xml中注意添加activity的风格。。 <activity android:name=".activity.MoraGameRequestActivity" android:theme="@android:style/Theme.Dialog" />
    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:background="#888888"
        >  <TextView android:id="@+id/textview1"
    android:layout_width="fill_parent"
        android:layout_height="30dip"
        android:gravity="center"
        android:text="提示" />    
    <TextView android:id="@+id/textview2"
    android:layout_width="fill_parent"
        android:layout_height="30dip"
        android:layout_below="@+id/textview1"
        android:gravity="center"/>    
    <LinearLayout
    android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:layout_below="@+id/textview2"
        android:weightSum="2"
        android:gravity="center">    

    <Button 
    android:id="@+id/gamebutton1"
    android:layout_weight="1"
    android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="确定"
    android:gravity="center"/>
    <Button
    android:id="@+id/gamebutton2"
    android:layout_weight="1"
    android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="取消"    
    android:gravity="center"/>
    </LinearLayout>
    </RelativeLayout>
      

  5.   

    呵呵,打开一个不可见的activity,然后迅速关闭
      

  6.   

    不行吧,我写了个demo,用来监听网络的广播receiver,如果有加Activity,可以正常监听到网络变化,但是注释掉Activity,就接收不了广播了。。求教。或者把你的demo
    发我研究下。