Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Rac3rZer0

I don't get how this is incorrect

5 hours ago, Rac3rZer0 said:

here is this better? "com.deltaUtils.Notified"

If this is just for learning purposes, don't sweat it ;) Sorry if I came across as harsh or anything, wasn't my intention. Was just trying to give you a heads up in case you want to publish to the Play Store (eventually). It's possible no one would even care if you use com.delta, but who knows.

 

It's completely fine to make mistakes and ask questions, best way to learn, just keep at it :D

Recommended Posts

Posted · Original PosterOP

Hi im creating an app in android and I really don't understand how this is incorrect. For some reason it says "'=' Expected" at the ending "/".

<!-- XML -->

<!-- <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" uses-permission/> in -->

<application>
    <activity
        android:name="com.delta.utils.notify.settings.mainActivity"
        android:label="@string/title_activity_settings.main"
        android:theme="@style/AppTheme.NoActionBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity
            android:name="com.delta.utils.notify.settings.mainActivity"
            android:label="Settings" />


        <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" uses-permission/> <!-- here -->

 </activity>

 


Ok Boomer

Link to post
Share on other sites
Posted · Original PosterOP

I just started doing apps, although i can understand advanced words in code, as i have learned some, but i am still a newbie in some ways


Ok Boomer

Link to post
Share on other sites
4 minutes ago, Rac3rZer0 said:

I just started doing apps, although i can understand advanced words in code, as i have learned some, but i am still a newbie in some ways

Note: I haven't done any serious coding in like... 10+ years, and I've never done Android coding.

 

But, if I were to guess, it would be here:

    <activity
        android:name="com.delta.utils.notify.settings.mainActivity"
        android:label="@string/title_activity_settings.main"
        android:theme="@style/AppTheme.NoActionBar">

In particular, the closing bracket ">" at the end of ".NoActionBar" is the only closing bracket in your code that doesn't have a backlash "/".

 

Should that be a "/>" instead of a ">"?


For Sale - iPhone SE 32GB - Unlocked - Rose GoldSold

Spoiler

 

 

* Intel i7-4770K * ASRock Z97 Anniversary * 16GB RAM * 750w Seasonic Modular PSU *

* Crucial M4 128GB SSD (Primary) * Hitachi 500GB HDD (Secondary) *

* Gigabyte HD 7950 WF3 * SATA Blu-Ray Writer * Logitech g710+ * Windows 10 Pro x64 *

 

Link to post
Share on other sites

Remove the "uses-permission"  before the /> 

 

<tag attr1="val" attr2="val"  />

 

or

 

<tag attr1="val" attr2="val" >

<!-- children may be here -->

</tag>

 

there's also other mistakes ..

 

the stuff right after

</intent-filter>

seems like they're attributes of the activity tag, and you accidentally pasted that intent-filter tag in the wrong place.

Maybe it should be this ?

 

<application>
    <activity
        android:name="com.delta.utils.notify.settings.mainActivity"
        android:label="@string/title_activity_settings.main"
        android:theme="@style/AppTheme.NoActionBar"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme" >  <!-- start activity tag>
        
        
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>  <!-- child of activity tag -->


        <activity
            android:name="com.delta.utils.notify.settings.mainActivity"
            android:label="Settings" /> <!-- child of activity tag -->


        <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> <!-- child of activity tag -->
	</activity>
 </application>
 
 Do you have activity within activity, or did you want intent-filter to be part of first activity?	 

 

Link to post
Share on other sites
Posted · Original PosterOP

Fixed a lot of errors and cleaned up, now i still have errors

 

        android:name="com.delta.utils.notify.settings.mainActivity"
        android:label="Settings"
        android:theme="@style/AppTheme.NoActionBar"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

        <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" uses-permission/>

    </activity>

 


Ok Boomer

Link to post
Share on other sites
Posted · Original PosterOP

One error left: in the very top left bracket "<"

 

<application>
    <activity

        android:name="com.delta.utils.notify.settings.mainActivity"
        android:label="Settings"
        android:theme="@style/AppTheme.NoActionBar"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

        <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>

    </activity>
</application>

 


Ok Boomer

Link to post
Share on other sites
5 hours ago, Rac3rZer0 said:

One error left: in the very top left bracket "<"

-snip-

An XML validator might be helpful, if you're doing any amount of XML work: https://www.xmlvalidation.com/

It gives an error in line 2/3, where you open activity, but don't close it an just go straight to android:name. Double check if that is correct.


I apologize for the way I am. If my post seemed rude, that was not my intention. Just my ineptness in forming a nice coherent message.

"Why do we suffer a lifetime for a moment of happiness?" - Anonymous

"FuryBSD, name of your sex tape" - Alex Clark

"How long do I have to keep going on? Someone end it already"

Link to post
Share on other sites
6 hours ago, Rac3rZer0 said:

One error left: in the very top left bracket "<"

 


<application>
    <activity

        android:name="com.delta.utils.notify.settings.mainActivity"
        android:label="Settings"
        android:theme="@style/AppTheme.NoActionBar"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

        <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>

    </activity>
</application>

 

Probably because you placed the "uses-permission" where it doesn't belong. The permissions used by your application belong inside the manifest block, not to a specific activity. Aren't you using Android Studio? When you mouse over the error, it should give you more information.

 

Here's an example:

Spoiler

2009849734_Screenshotfrom2020-01-0709-56-06.png.90ecb65dc34de6f9e10badb8bb6f48ce.png

 

~edit: Btw. unless you work for Delta Airlines or the domain delta.com belongs to you, you shouldn't be using "com.delta" as your package name and the name of the activity should start with an uppercase letter (i.e. MainActivity not mainActivity). By convention, the package name should be based on a domain you own.

 

It should look similar to this:

Spoiler

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

    <!-- Permissions go here -->
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />

    <application
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name">

        <activity
            android:name="com.delta.utils.notify.settings.MainActivity"
            android:allowBackup="true"
            android:icon="@mipmap/ic_launcher"
            android:label="Settings"
            android:label="@string/app_name"
            android:roundIcon="@mipmap/ic_launcher_round"
            android:supportsRtl="true"
            android:theme="@style/AppTheme.NoActionBar"
            android:theme="@style/AppTheme">

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

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

    </application>
</manifest>

 

 


Remember to quote or @mention others, so they are notified of your reply

Link to post
Share on other sites
Posted · Original PosterOP

had to create a new project becaus this one has too many errors, but yk this was not all for nothing, at least im learning, I a very confused, and confusing person yk...


Ok Boomer

Link to post
Share on other sites
Posted · Best Answer
5 hours ago, Rac3rZer0 said:

here is this better? "com.deltaUtils.Notified"

If this is just for learning purposes, don't sweat it ;) Sorry if I came across as harsh or anything, wasn't my intention. Was just trying to give you a heads up in case you want to publish to the Play Store (eventually). It's possible no one would even care if you use com.delta, but who knows.

 

It's completely fine to make mistakes and ask questions, best way to learn, just keep at it :D


Remember to quote or @mention others, so they are notified of your reply

Link to post
Share on other sites
Posted · Original PosterOP
19 hours ago, Eigenvektor said:

If this is just for learning purposes, don't sweat it ;) Sorry if I came across as harsh or anything, wasn't my intention. Was just trying to give you a heads up in case you want to publish to the Play Store (eventually). It's possible no one would even care if you use com.delta, but who knows.

 

It's completely fine to make mistakes and ask questions, best way to learn, just keep at it :D

Thanks!


Ok Boomer

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×