当前位置: 首页 > news >正文

高端的网站建设公司哪家好秘密入口3秒自动进入

高端的网站建设公司哪家好,秘密入口3秒自动进入,网站建设项目分析报告,招聘网站做沙龙1 前言 之前在工作中,第一次听到launcher有点蒙圈,不知道是啥,当时还赶鸭子上架去和客户PK launcher的事。后来才知道其实就是安卓的桌面。本来还以为很复杂,毕竟之前接触过windows的桌面,那叫一个复杂。。。 后面查了…

1 前言

之前在工作中,第一次听到launcher有点蒙圈,不知道是啥,当时还赶鸭子上架去和客户PK launcher的事。后来才知道其实就是安卓的桌面。本来还以为很复杂,毕竟之前接触过windows的桌面,那叫一个复杂。。。

后面查了一下,Android的桌面倒是没那么复杂,本质其实就是一个App,系统启动之后跑起来的第一个app。

Android Launcher 是一个应用程序,用于显示设备的主屏幕,并且是启动其他应用的入口。简单来说,Launcher 是 Android 设备的“应用启动器”,负责管理和展示设备的主屏幕、应用图标、桌面小部件(widgets)以及应用程序的启动行为。

2 操作步骤

最近搭建了app的环境,现在借着之前搭建的环境(Android学习20 -- 手搓App2(Gradle)-CSDN博客),试着弄一个launcher。

*   The key to making your app a launcher is to declare the correct intent filter in your `AndroidManifest.xml` file. This tells the Android system that your app is capable of acting as a launcher.
*   Here's how your `AndroidManifest.xml` should look (specifically the `<activity>` tag for your

所以修改之后的AndroidManifest.xml是这样。

<manifest xmlns:android="http://schemas.android.com/apk/res/android"package="com.example.simpleapp"><applicationandroid:allowBackup="true"android:icon="@mipmap/ic_launcher"android:label="SimpleApp"android:theme="@style/Theme.AppCompat.DayNight"><activityandroid:name=".MainActivity"android:label="SimpleApp"><intent-filter><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LAUNCHER" /><category android:name="android.intent.category.HOME" /><category android:name="android.intent.category.DEFAULT" /></intent-filter></activity></application>
</manifest>

最核心的就是在intent filter里面的配置,重点就是这几行。

                <category android:name="android.intent.category.LAUNCHER" />
                <category android:name="android.intent.category.HOME" />
                <category android:name="android.intent.category.DEFAULT" />

 * **Explanation:** *

`<action android:name="android.intent.action.MAIN" />`: This is the standard action for the main entry point of an app. * `

<category android:name="android.intent.category.LAUNCHER" />`: This category indicates that this activity should be listed in the app launcher (the list of apps). * `

<category android:name="android.intent.category.HOME" />`: This is the crucial category that tells the system this activity can act as a home screen replacement. * `

<category android:name="android.intent.category.DEFAULT" />`: This category is often used with `HOME` to ensure your app is considered a valid home screen option. * 

MainActivity.java。主界面上面就是一个按钮,点了之后会启动一个浏览器。

package com.example.simpleapp;import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import androidx.appcompat.app.AppCompatActivity;public class MainActivity extends AppCompatActivity {@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);// 获取按钮控件Button openBrowserButton = findViewById(R.id.openBrowserButton);// 设置按钮点击事件openBrowserButton.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View v) {// 启动浏览器Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.google.com"));startActivity(browserIntent);}});}
}

这里就实现了前面说的启动应用程序的功能,就是通过startActivity(browserIntent);

之后要指定布局,也就是res/layout/activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical"android:gravity="center"><!-- 启动浏览器按钮 --><Buttonandroid:id="@+id/openBrowserButton"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="Open Browser" />
</LinearLayout>

编译用之前调好的就行。

gradle wrapper
gradlew assembleDebug

编译的时候会报错,说mipmap,drawable找不到。

可以去Android Studio创建好的工程里面拷贝过来。完了大概是这样的。里面也就是一堆xml。

之后就可以顺利编过,安装也比较简单。直接运行就是这样:

3 未能最终完成。。

但是有一点很遗憾,在荣耀的平板里面,这个是叫做桌面。自己做的这个launcher,怎么都没法设置进去。除了默认的华为桌面,找不到可以设置的地方。

查了一下,有可能是我的设置还有点问题,但是大概率还是华为的平板把这部分的权限给关了。估计只有以后找一个干净的AOSP再试试了。。。 

http://www.ds6.com.cn/news/100802.html

相关文章:

  • 太仓建设工程信息网站网站发布与推广方案
  • 合肥模板网站建设软件seo排名优化怎么样
  • 给你网站你会怎么做百度快速seo
  • 网站开发哪一种语言好营销手段
  • 开发门户网站宁波网站推广方式怎么样
  • 网站开发的项目流程网站模板平台资源
  • 实现网站计划书整合营销的特点有哪些
  • 青岛建站seo公司上海公司排名
  • 活动营销推广方案网络舆情优化公司
  • 电商基础入门教程网站优化技巧
  • 毕业论文的网站做企业seo服务
  • 做二手房的端口网站2023年新闻热点事件摘抄
  • 搭建网站 在线浏览功能东营优化公司
  • 想做机械加工和橡胶生意怎么做网站91关键词排名
  • 建立旅游公司网站多钱网站营销软文
  • 做彩票的网站吗廊坊seo整站优化
  • 点击即玩的小游戏网站今日头条网页版入口
  • 单职业传奇网站seo就业前景如何
  • 中国建设银行网站首页签约网站搜索优化技巧
  • 在线教育网站源码淄博网站seo
  • 免费网站平台亚马逊提升关键词排名的方法
  • 企业网站为什么要备案百度建站云南服务中心
  • 南京小程序开发网站建设免费发布推广信息的软件
  • 数据库对于做网站的重要性看颜色应该搜索哪些词汇
  • 电商平台网站制作哪个平台做推广效果好
  • 网站做飘浮怎么做柏乡seo快排优化
  • 关于进行网站建设费用的请示上海牛巨微seo关键词优化
  • wordpress建站后怎样发布刚出来的新产品怎么推
  • 动态网站首页模版在线搜索引擎
  • 外国网站域名在哪查贺州seo