First off, I want to say that I'm a really inexperienced android programmer. I've never worked with android studio but I've decided to learn. I need to complete my final course project which is an android app that allows users to search and share their experiences with the world!
In the android gallery I want to add to that "Share" button, my app, which, when clicked, would redirect the user to the "Profile Fragment" with a button saying "Share to the world!". I know that this is possible as I have already seen some questions like this. The problem is, as I said, I am a little noob in this android programming. Can someone explain how can I resolve my problem is some detailed way?
Thanks in advance!
EDIT:
This is my manifest.xml
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:largeHeap="true"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".LoginActivity"
android:screenOrientation="portrait"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:screenOrientation="portrait"
android:theme="#style/AppTheme.NoActionBar"
/>
<activity android:name=".SplashActivity"
android:screenOrientation="portrait"
android:theme="#style/AppTheme.NoActionBar" />
</application>
Related
My home page needs to show two buttons: login & register. The page Login Activity with both buttons should appear first, but only the register screen comes up.
I am very new to coding. So, please be nice :( I've been stuck on this for days.
Below is the AndroidManifest.xml. Can anyone spot what I am doing wrong?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.thrd">
<application
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=".LoginActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".RegisterActivity"></activity>
<activity android:name=".UserAreaActivity"></activity>
</application>
</manifest>
You manifest file is ok. Probably you have some logical errors in your code. In LoginActivity. So it launches RegisterActivity (probably in onCreate), instead of showing itself.
I have been trying to download some stuff from the internet in my app, but in the second activity. I have added the permission request, and it works in my first activity, but not in the second one? is there anything i'm forgetting? otherwise, why would i possibly be getting a permission error?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.ruslan.seriesstuff">
<uses-permission android:name="android.permission.INTERNET"/>
<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:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name=".Main2Activity">
</activity>
</application>
The problem occurred because of the newer version of android, in my case 6.0. I solved this problem by doing the following. Long press on the app icon in your phone, drag it to the appeared icon of app info. There go to the permissions of the app and make sure you have actually provided the permission to the internet. That's it!
first timer here (both in development and posting in SO). I've used idunnololz to create an animated listview for a simple reference app I'm trying to make. It's turned out really well, but after I've created it, when I run the app to test it, it now runs as AnimatedExpandableListView both in the ActionBar title and in the app drawer. I've searched here and found that you can get the app to launch with a different activity by editing the AndroidManifest.xml, so I verified that I'm pointing to my MainActivity class:
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
I presume this may be an issue with the MainActivity class, but maybe there's something here that I'm missing?
I found my answer here:
Android: App name shows the first page name, not the app name
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter **NEED #string/app_name HERE**>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
I am very new to android development with eclipse, and I encounter dozen of errors and problems. Here is the next one:
I am following an android tutorial given here in order to set up the action bar. In this tutorial is says to insert an activity as follows:
<activity android:theme="#style/Theme.AppCompat.Light" ... >
Can I just put this line into the xml manifest file?
<activity android:theme="#style/Theme.AppCompat.Light">
Or do I need to replace the '...' by something more useful?
Please read the docs: activity-element
The activity's name is required, so you would need to have:
<activity android:theme="#style/Theme.AppCompat.Light" android:name="MyActivity">
Other than that, you are not required to add any other attributes.
Although be sure to place the activity element within the proper place in your xml. It should be contained in your application block:
<application android:label="#string/app_name"
android:icon="#drawable/ic_launcher"
android:theme="#android:style/Theme.Holo.Light">
<activity android:name="MyActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
Unless you really want your app to work under API levels under 3.0 then you have to add it like this.
android:theme="#style/Theme.AppCompat.Light"
Inside your already defined activity in your manifest (the one that has the intent filter and other declarations).
otherwise you dont have to add that at all.
This is one example.
<activity
android:name=".MainActivity"
android:theme="#style/Theme.AppCompat.Light"
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>
and this is another
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme=#style/Theme.AppCompat.Light"" >
<activity android:name=".DetailActivity"
android:label="#string/app_name" >
</activity>
The second way you posted is just fine, be sure to close the activity tag so it looks like <activity android:theme="#style/Theme.AppCompat.Light"></activity>
Also, if you're using eclipse, it is easier to go into the AndroidManifest and under the Application tab scroll to the bottom where there's Application Nodes and then add your view from there. Eclipse will auto generate the correct code in the xml file.
I've made an application and the AndroidManifest.xml has these attributes:
<application
android:allowBackup="true"
android:icon="#drawable/flower"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.manish.tabdemo.TabHostActivity"
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="com.manish.tabdemo.HomeActivity"/>
<activity android:name="com.manish.tabdemo.AboutActivity"/>
<activity android:name="com.manish.tabdemo.ContactActivity"/>
</application>
If you look at this picture you see the main page of my app. I want to change that TabHostDemo you see next to the fire flower with MK7 VRs List.
I googled and I found that if I want to change the title I have to edit some stuff in this way:
android:label="#string/app_name"
android:label="#string/app_name"
becomes...
android:label="#string/MK7 VRs List"
android:label="#string/MK7 VRs List"
If I do this I have an error that tells me "No resources found that matches the given name". Can you help me?
go to string/app_name and change it to what ever you want
<activity
android:name="com.manish.tabdemo.TabHostActivity"
android:label="#string/app_name" >
Open res/values/strings.xml and change the value of app_name in it. Then do a clean build.
OR
or directly use android:label="MK7 VRs List"