手机
当前位置:查字典教程网 >编程开发 >安卓软件开发 >点击图标进入指定浏览器将首页设置全透明解决一闪而过问题
点击图标进入指定浏览器将首页设置全透明解决一闪而过问题
摘要:点击图标进入指定浏览器。只需在onCreate()方法里添加如下代码:Stringurl="http://tiger-kfphone.com...

点击图标进入指定浏览器。

只需在onCreate()方法里添加如下代码:

String url = "http://tiger-kfphone.com/"; Uri u = Uri.parse(url); Intent intent = new Intent(Intent.ACTION_VIEW, u); // intent.setData(u); // intent.setClassName("com.android.browser", // "com.android.browser.BrowserActivity"); startActivity(intent); finish();

但是在进入浏览器之前有一个页面闪了一下,那是因为从那个空白的首页跳过去的。客户说不要那个一闪而过的页面,说是个bug。

最后解决的办法是把他变成透明的就好了。

在styles.xml里添加如下代码:

<style name="Translucent_NoTitle" parent="android:style/Theme.Dialog"> <item name="android:windowNoTitle">true</item> <item name="android:background">#00000000</item> <item name="android:windowBackground">@android:color/transparent</item> <item name="android:colorBackgroundCacheHint">@null</item> <item name="android:windowIsTranslucent">true</item> </style>

然后在AndroidManifest里添加如下代码:

<activity android:name="com.hklt.link.MainActivity" android:label="@string/app_name" android:theme="@style/Translucent_NoTitle" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity>

【点击图标进入指定浏览器将首页设置全透明解决一闪而过问题】相关文章:

android ListView和GridView拖拽移位实现代码

Android用户界面开发之:TextView的使用实例

Android开发笔记之: 数据存储方式详解

Android 四种动画效果的调用实现代码

android 权限大全 分享

Android不需要关闭后台运行程序

ÔÚAndroidϵͳÖÐʹÓÃgzip½øÐÐÊý¾Ý´«µÝʵÀý´úÂë

android开发之调用手机的摄像头使用MediaRecorder录像并播放

android获取音乐文件的内置专辑图片实现思路及代码

Android Service(不和用户交互应用组件)案例分析

精品推荐
分类导航