Editing ActionBar in Eclipse - Android - android

I am working on a new Android application with a navigation with the fixed tabs and scroll-able default option Eclipse gives you.
But when looking on my .xml files for the mainActivity and the dummy file that are generated automatically, I can't find out where to edit the titles and whatnot for each individual tab section.
Do you know what I need to do?

You can change the default value of tabs by changing res/values/string.xml>title_section(x). Note: using resource string files should be something you get very familiar with as you should try your best to separate any "magic strings" from your code. Basically all strings should go in a resource file and be referenced through getString.

Related

How to change default template layout files in Android Studio

As you know every time you create new project with some activity, Android Studio generates a default activity_main.xml file with RelativeLayout as the root element and one TextView. But I prefer to use LinearLayout without any nested views. How can I change the way Android Studio generates the default activity_main.xml?
You can do that by editing default template files, which are located in:
...\Android\Android Studio\plugins\android\lib\templates\activities
so for example, default layout file for template of EmptyActivity (note: this one is specific, the other ones have their own res folders) is located in:
...\Android\Android Studio\plugins\android\lib\templates\activities\common\root\res\layout\simple.xml.ftl
by simply replacing RelativeLayout with LinearLayout in your favourite text editor, you get what you want, but instead of that, I recommend you to make your own template, where you can define literally anything, according to your desires.
Edit: For the BlankActivity and a guide how to edit the other templates see this link:
How to change a BlankActivity template default files and a guide how to do it for any others.
in our course, we hacked the default activity. It worked as expected, still a side effect occured while upgrading from Android Studio 3 to 3.1.
The installation wizard detected the default activity template was modified and we had to replace our hacked version with a stock one.
So I suggest creating your own templates in the way Android Studio expects it (ie, through the template options) for a smooth upgrade process.

Android: Trying to use a inbuilt layout xml file - simple_list_item_2_single_choice symbol cannot be resolved

I'm trying to create a listview where each item in the listview has two lines of text and a radio button at the end, so you can select one of the items in the list and then click next.
simple_list_item_2_single_choice.xml does exactly this, and it is integrated into android.
I have already used simple_list_item_2 which is built in for android on another screen without problems, and I can see that simple_list_item_2_single_choice is in
...\android-studio\sdk\platforms\android-20\data\res\layout
but when I try to reference it in my code, I get the error: cannot resolve symbol 'simple_list_item_2_single_choice'
Does anyone know how to make my app recognize this inbuilt file?
Does anyone know how to make my app recognize this inbuilt file?
Step #1: Copy the file into your app project.
Step #2: Reference your copy from your Java code.
While that layout file may be part of Android, it is not part of the Android SDK, as you will not see that resource listed in the android.R.layout package.

Why do the Resources and strings.xml tabs not match?

I've tried to create my own string resource 'click_me' using values > strings.xml and then using the Resources tab to add Strings. I created a few too many but I'm unable to delete the extra Strings. When I click on remove the extra Strings are not removed from the resources tab.
Yet when I switch to the strings.xml tab only the default strings remain. I would like the Resources and strings.xml tabs to sync as I'm sure they're probably meant to. What's gone wrong here?
I tried it too and the problem is same here too. There seems to be a known issue and is posted here. I suppose its only logical to edit string resource directly in xml until the issue is fixed. My Adt version and relevant information:
Android Developer Tools
Build: v22.6.2-1085508
Blockquote

Using view in android application

In the link given,there is code for 'circular-menu' view.
I am intrested in using that in apllication.
But not getting how to add that in application.
So,please help me.
Android Catch Notes App Like Circle Menu
That should be easy:
Search the referenced icons and put them in your res/drawable-???? folders
Possibly change the references to their ids
Copy the text into a new File named SmallCircleView.java in your src dir
Add the necessary import statements
Incorporate it in your layout
If that's not working, provide more information.

Finding the com..... to use in Android Layout

I am using this tutorial to try to replace the default TitleBar with a custom ActionBar. I am to the part where I am trying to create the xml layout for the custom title (#2 Under INCLUDING THE ACTIONBAR WIDGET IN YOUR APPLICATION), and the tutorial defines the ActionBar in the xml using
com.thira.examples.actionbar.widget.ActionBar
I have no idea how to figure out what to put there for my ActionBar. I believe this is called the package name. If so, how do I figure out what mine is. If not, what am I looking for here?
There are a couple options for figuring out your package name. The first (and easiest) is to declare it yourself in the project properties dialog:
Alternatively, if you haven't defined it yourself you can take a look at the AndroidManifest.xml file that is generated as part of the packaging step of the build. You can find it in the obj/Debug/android folder of your project.

Categories

Resources