如何实现一个没有主activity的android程序呢 就是点击一下程序的图标,执行一些代码,并不显示任何界面。那么怎么实现这种需求呢,代码入口在哪儿? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这个貌似不行吧……android的开发本身就是可视化的吧。 android 有这样的“接口” 首先你 新建项目的时候不要选Create Activity 然后用广播获取 系统启动广播 在开启 Service不过点击图标这个倒是没想过 楼主 你可以做一个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> 呵呵,打开一个不可见的activity,然后迅速关闭 不行吧,我写了个demo,用来监听网络的广播receiver,如果有加Activity,可以正常监听到网络变化,但是注释掉Activity,就接收不了广播了。。求教。或者把你的demo发我研究下。 实现圆角边框的阴影效果 关于android添加第三方字体的方法 AVD 无法关闭 求一个简单的游戏状态保持的Demo Service 多次启动对系统有没有影响? 有没人知道如何通过gsm/gprs获得地理位置啊? 状态栏自定义图标的重现 send会阻塞比较长的时间? android 缤果动漫 客户端,那个滑动菜单 是怎么实现的 请问 Android 如何解决控件层叠顺序 ArrayAdapter的问题,我传进来一个20位的数组 但是显示出来就是40位 很邪门 内有代码 显示的是传进来数组位数的2倍 android正式发布产品的步骤
首先你 新建项目的时候不要选Create Activity 然后用广播获取 系统启动广播 在开启 Service
不过点击图标这个倒是没想过
我给你写个简单的布局文件
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>
发我研究下。