Activity Declaration in AndroidManifest.xml
You have two activities in your package, but have only declared one in manifest.
Declare the other Activity class:
Add this to your manifest:
<activity
android:name="com.example.stockquote.StockInfoActivity"
android:label="@string/app_name" />
declaring an activity in AndroidManifest
Try This
Read doc about Manifest file Manifest file structure
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.brianballz.a1ibsos">
<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"
android:theme="@style/AppTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".CreateAccountActivity"></activity>
<activity android:name=".LoginActivity"></activity>
</application>
</manifest>
Error: have you declared this activity in your AndroidManifest.xml? when trying to intent a class
You cannot use an Intent
to start/create a Fragment
much like you would for an Activity
. A Fragment
actually lives inside an Activity
i.e. its lifecycle is bound to an Activity
. To start a Fragment
you have to use the FragmentManager
that is available with the Activity
instance
This error is coming up because Android thinks that your InformationFragment
is an Activity
rather than a Fragment
and hence it is asking you if you have declared it in your AndroidManifest.xml
file because as the rule says, you need to have each Activity
in your app declared inside the AndroidManifest.xml
file
So, now you can use something like this, inside your showInfoActivity. Technically there are many solutions available as to what you could essentially do and that's why I linked you to all possible solutions rather than just writing them here
Android Studio says Mainactivity is not declared in AndroidManifest.xml ?
There could be two scenarios.
1) you have your MainActivity.java
class but you haven't created activity_main.xml
thats why you didn't declared you Activity in your android manifest.
2) You have your both java class and xml class but you didn't declared your activity in android manifest.
NOTE: This issue only occur when you forgot to declare your activity in android manifest.
...have you declared this activity in your AndroidManifest.xml
You have declared this activity outside application tag.
<activity android:name=".Compte" android:screenOrientation="portrait" />
Make it like this :
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@android:style/Theme.Light.NoTitleBar" >
<activity
android:name=".Menu"
android:screenOrientation="portrait"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Compte"
android:screenOrientation="portrait" />
</application>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
Related Topics
How to Set a Particular Font for a Button Text in Android
How to Open an Android Studio Project in Eclipse
Only Load Layout When Firebase Calls Are Complete
Android SQLite Issue - Table ... Has No Column Named
Toolbar and Contextual Actionbar with Appcompat-V7
Programmatically Collapse or Expand Collapsingtoolbarlayout
How to Force Action Bar Overflow Icon to Show
Save Image to Sdcard from Drawable Resource on Android
How to Run Code on a Background Thread on Android
Android Compass That Can Compensate for Tilt and Pitch
Custom Row in a Listpreference
Ndk Resolution Outcome: Project Settings: Gradle Model Version=5.4.1, Ndk Version Is Unknown Error
Startactivity() from Broadcastreceiver
Shadow Effect for a Text in Android