GoConqr has a new look! Let us know what you think.

Mind map

Cookbook

John Aley Portuguese

Map content

Cookbook

  1. §1.Activity

    • 1. Declaring an activity
      • AndroidManifest.xml
        •  Declaring an activity is how we tell the system about our activity and how it can be requested. For example, an pplication will usually indicate that at least one activity should be visible as a desktop icon and serve as the main entry point to the application.
        • <application <activity </activity> </application>
          • Declaring an activity is a simple matter of declaring the &lt;activity&gt; element and specifying&nbsp; the name of the activity class with the android:name attribute. By adding the &lt;activity&gt;&nbsp; element to the Android Manifest, we are specifying our intention to include this component&nbsp; within our application. Any activities (or any other component for that matter) that are not&nbsp; declared in the manifest will not be included in the application. Attempting to access or utilize&nbsp; an undeclared component will result in an exception being thrown at runtime. android:label . This attribute indicates the title shown on the screen as well as the icon label if this is the Launcher activity.
    • 2. Starting a new activity with an intent object
      • Add intent function
        • public void launchIntent(View view) { Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse("https://www.packtpub.com/")); startActivity(intent); }
      • Creat button
        • activity_main.xml
          • &lt;Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Launch Browser" android:id="@+id/button" android:layout_centerVertical="true" android:layout_centerHorizontal="true" android:onClick="launchIntent"/&gt;
    • 3. Switching between activities
      • Create a new black activity
      • Activity_main.xml, Create button
        • onclick
      • Crie uma função, que recebe um obj intent, que acione o ACTION_VIEW, passe o dado e dps chame a porra da mizera

Information

Description
Mind Map on Cookbook, created by John Aley on 26/01/2018.
Created by
John Aley
Views
1
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?