1. Are you ready for the Galaxy S20? Here is everything we know so far!

the activity must be exported or contain an intent-filter

Discussion in 'Android Development' started by mtahirkn, Apr 5, 2021.

  1. mtahirkn

    mtahirkn Lurker
    Thread Starter

    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
     



    1. Download the Forums for Android™ app!


      Download

       
  2. Unforgiven

    Unforgiven ...eschew obfuscation...
    Moderator

    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 (Text):
    1. Line 1
    2. Line 2
    3. Line 3
    4.     Maintains white space
    5.     Doesn't turn :) into emoji
    6. etc...
    7.  
     
  3. mtahirkn

    mtahirkn Lurker
    Thread Starter

Loading...
Similar Threads - activity must exported
  1. aprengo
    Replies:
    7
    Views:
    414
  2. SteveP29
    Replies:
    3
    Views:
    2,226
  3. RatherLoopy
    Replies:
    7
    Views:
    922
  4. SteveP29
    Replies:
    5
    Views:
    2,102
  5. Jimbo84
    Replies:
    8
    Views:
    2,547
  6. blazinglazers
    Replies:
    7
    Views:
    1,800
  7. Boowho
    Replies:
    2
    Views:
    1,356
  8. ZepTepi
    Replies:
    24
    Views:
    3,433
  9. Gangul
    Replies:
    0
    Views:
    2,077
  10. EmbersBliss
    Replies:
    4
    Views:
    768

Share This Page

Loading...