My XML File is following
named as activity_asad_xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_asad__class"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.asad.se.Asad_Class"> <Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
android:id="@+id/btn" /> </RelativeLayout>
My Java File is following
named as Asad_Class
package com.example.asad.se; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.Button; public class Asad_Class extends AppCompatActivity { Button btn1; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_asad__class); btn1=(Button) findViewById(R.id.btn); } }My Manifest File Is Following<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android"package="com.example.asad.se"> <applicationandroid:allowBackup="true"android:icon="@mipmap/ic_launcher"android:label="@string/app_name"android:supportsRtl="true"android:theme="@style/AppTheme"> <activity android:name=".Asad_Class"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest>This is the simple android application for the declaration of a button.I hope you will like this and don't forget to like and subscribe
No comments:
Post a Comment