Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the configuration files for singleTask

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces the relevant knowledge of "what are the configuration files of singleTask". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Notice that the launchMode property of the SubActivity here is configured as "singleTask".

Let's look at the interface configuration file.

They are defined in the res/layout directory, and the main.xml file corresponds to the interface of MainActivity:

[html] view plaincopy

Android:orientation= "vertical" android:layout_width= "fill_parent" android:layout_height= "fill_parent" android:gravity= "center" > android:id= "@ + id/button_start" android:layout_width= "wrap_content" android:layout_height= "wrap_content" android:gravity= "center" android:text= "@ string/start" >

Sub.xml corresponds to the interface of SubActivity: [html] view plaincopy

Android:orientation= "vertical" android:layout_width= "fill_parent" android:layout_height= "fill_parent" android:gravity= "center" > android:id= "@ + id/button_finish" android:layout_width= "wrap_content" android:layout_height= "wrap_content" android:gravity= "center" android:text= "@ string/finish" >

The string file is located in the res/values/strings.xml file: [html] view plaincopy

Task Sub Activity Start singleTask activity Finish activity

*, we also need to place a compilation script file Android.mk in the project directory:

[html] view plaincopyLOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE_TAGS: = optional LOCAL_SRC_FILES: = $(call all-subdir-java-files) LOCAL_PACKAGE_NAME: = Task include $(BUILD_PACKAGE) "what are the configuration files for singleTask"? thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report