• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

the activity must be exported or contain an intent-filter

mtahirkn

Lurker
Apr 5, 2021
2
0
Dear forum members I am facing this problem when I start my application please someone help
here my android manifest coding

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.myfirstapplication.tahirkhan.myapplication">

<application
android:allowBackup="true"
android:icon="@Mipmap/ic_launcher"
android:label="@String/app_name"
android:supportsRtl="true"
android:theme="@Style/AppTheme">
<activity android:name=".MainActivity" />
<activity android:name=".TahirCalculator" />

<activity android:name=".Splash">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>

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

</intent-filter>
</activity>



</application>

</manifest>

and this code for calculator

package com.myfirstapplication.tahirkhan.myapplication;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class TahirCalculator extends AppCompatActivity {
EditText edtfirst, edtsecond;
Button btnadd, btnminus, btnsubtract, btndevid;
TextView tvresult;

@override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_tahir_calculator);

edtfirst=(EditText) findViewById(R.id.edtfist);
edtsecond=(EditText) findViewById(R.id.edtsecond);
tvresult=(TextView) findViewById(R.id.tvresult);

btnadd=(Button) findViewById(R.id.btnadd);
btnminus=(Button) findViewById(R.id.btnminus);
btnsubtract=(Button) findViewById(R.id.btnsubtract);
btndevid=(Button) findViewById(R.id.btndevid);

btnadd.setOnClickListener(new View.OnClickListener(){

@override
public void onClick(View v) {
int first, second, result;
first=Integer.valueOf(edtfirst.getText().toString());
second=Integer.valueOf(edtsecond.getText().toString());
result=first+second;
tvresult.setText("Your Result is"+result);
}
});



}


}

Thanks
 
I moved this to the development area for better exposure.
Using code tags will help make your post more readable for the folks that can help.
Code Tag Usage:
[code]Line 1
Line 2
Line 3
Maintains white space
Doesn't turn :) into emoji
etc...
[/code]
Code:
Line 1
Line 2
Line 3
    Maintains white space
    Doesn't turn :) into emoji
etc...
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones