One: How to create an activity
Too lazy to type, direct
650) this.width=650; "Src=" Https://s4.51cto.com/oss/201711/11/10e2c728ad0157090d2a28c3887a670c.png-wh_500x0-wm_3 -wmp_4-s_3866123293.png "style=" Float:none; "title=" QQ picture 20171111160258.png "alt=" 10e2c728ad0157090d2a28c3887a670c.png-wh_ "/>
650) this.width=650; "Src=" Https://s3.51cto.com/oss/201711/11/9dbb31468a01a56997b101da257fdcf7.png-wh_500x0-wm_3 -wmp_4-s_764684516.png "style=" Float:none; "title=" QQ picture 20171111160319.png "alt=" 9dbb31468a01a56997b101da257fdcf7.png-wh_ "/>
First, where the testactivity code is as follows
Package Com.example.qingdan;
Import Android.os.Bundle;
Import android.app.Activity;
Import Android.view.Menu;
public class Mainactivity extends Activity {
@Override
protected void OnCreate (Bundle savedinstancestate) {
Super.oncreate (savedinstancestate);
Setcontentview (R.layout.activity_main);
}
@Override
public boolean Oncreateoptionsmenu (Menu menu) {
Inflate the menu; This adds items to the action bar if it is present.
Getmenuinflater (). Inflate (R.menu.main, menu);
return true;
}
}
Activity_test.xml in the following
<?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" >
<textview
Android:layout_width= "Match_parent"
android:layout_height= "Wrap_content"
android:text= "Wo shi Test"
/>
</LinearLayout>
Let's run this file, and find out if it shows HelloWorld.
What's the reason?
<activity
Android:name= "Com.example.qingdan.MainActivity"
Android:label= "@string/app_name" >
《! ----"Main Entrance"
<intent-filter>
<action android:name= "Android.intent.action.MAIN"/>
<category android:name= "Android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
Above
But how to change it?
Before we change, we have to know
Android has four components that need to be configured in Android
650) this.width=650; "Src=" Https://s5.51cto.com/oss/201711/11/31b56bf42f953efb515b926b3927a31e.png-wh_500x0-wm_3 -wmp_4-s_1814507850.png "title=" qq picture 20171111161331.png "alt=" 31b56bf42f953efb515b926b3927a31e.png-wh_ "/>
If not configured, copy and paste directly.
But what about two of these entrances?
Well, we'll let him have two entrances.
What happens after the run?
Or HelloWorld, will be wrong, we return to see the menu 650) this.width=650; "Src=" https://s1.51cto.com/oss/201711/11/ A77ee292d366536433cf2e2ebe8e1a2a.png-wh_500x0-wm_3-wmp_4-s_3096167113.png "title=" qq picture 20171111162006.png "alt=" A77ee292d366536433cf2e2ebe8e1a2a.png-wh_ "/>
Two manifest small files appear,
So what's the call in that?
A: that's it.
Android:label= "@string/app_name" >
It turns out this is
So what do we do?
Just change it.
650) this.width=650; "Src=" Https://s1.51cto.com/oss/201711/11/0bf490212e3398adaa03e0126e83e053.png-wh_500x0-wm_3 -wmp_4-s_4091810641.png "title=" qq picture 20171111163508.png "alt=" 0bf490212e3398adaa03e0126e83e053.png-wh_ "/>
Display again
We are going to have a fun next, how to configure your own app on your favorite pictures, he has two steps
The first step: find Baidu to find their favorite pictures
Second step: Configure the picture (bad laugh)
The author first to look for pictures
。。。。。
。。。。。
。。。。。
Well, found, Youku's Niang version, and a copy of my blog first image
650) this.width=650; "Src=" Https://s3.51cto.com/oss/201711/11/f37bbd593977d4718aa88689216cbb71.jpg-wh_500x0-wm_3 -wmp_4-s_1561481654.jpg "style=" float:left; "title=" download. jpg "alt=" F37bbd593977d4718aa88689216cbb71.jpg-wh_ "/>
650) this.width=650; "Src=" Https://s3.51cto.com/oss/201711/11/737421ee71336eb2f292887a7cbe5687.jpg-wh_500x0-wm_3 -wmp_4-s_1974761596.jpg "title=" eyebrow snow. jpg "alt=" 737421ee71336eb2f292887a7cbe5687.jpg-wh_ "/>
We'll use this to do the image of our app.
Copy it, put it in
650) this.width=650; "Src=" Https://s1.51cto.com/oss/201711/11/4f6c1282650c07857bd19b4b20faadf3.png-wh_500x0-wm_3 -wmp_4-s_1154277688.png "style=" Float:none; "title=" QQ picture 20171111170311.png "alt=" 4f6c1282650c07857bd19b4b20faadf3.png-wh_ "/>
And then the code is like this.
than previously needed to be included in the activity
650) this.width=650; "Src=" Https://s3.51cto.com/oss/201711/11/118541c560be2eb20834c7e68d76b861.png-wh_500x0-wm_3 -wmp_4-s_4212742796.png "title=" qq picture 20171111171411.png "alt=" 118541c560be2eb20834c7e68d76b861.png-wh_ "/>
Because the simulator is too jammed, so bro, I'm playing with a real machine test,
Fun, cool Niang just become your app image
650) this.width=650; "Src=" Https://s3.51cto.com/oss/201711/11/19fd4a9d0ba20bb0abd02d306b1a84b0.png-wh_500x0-wm_3 -wmp_4-s_2535909092.png "title=" qq picture 20171111170148.png "style=" Float:none; "alt=" 19fd4a9d0ba20bb0abd02d306b1a84b0.png-wh_ "/>
And there's a need to be aware that
This may result in multiple apps in one swoop
So how do you just produce one?
650) this.width=650; "Src=" Https://s1.51cto.com/oss/201711/11/0e79ba69f3182e6c5acca10adc2d155c.png-wh_500x0-wm_3 -wmp_4-s_3976241098.png "title=" qq picture 20171111171821.png "alt=" 0e79ba69f3182e6c5acca10adc2d155c.png-wh_ "/>
Change the launcher to default.
android-List Small File