[android-developers] Digest for android-developers@googlegroups.com - 5 updates in 5 topics

Comments: (0)
Jonathan Fajardo Roa <jfajardor9210@gmail.com>: Jul 29 06:55PM -0700

Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.process.ProcessException:
org.gradle.process.internal.ExecException: Process 'command
finished with non-zero exit value 2
Simon Giddings <mr.s.giddings@gmail.com>: Jul 29 08:44AM -0700

If anyone is needing to do the same thing, here is my working solution.
Note that I am targeting API 14 and above.
<style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar" >
<item name="android:actionMenuTextAppearance">

<!-- Override actionbar menu text appearance -->
<style name="myActionBarMenuText" parent=
<item name="android:textAllCaps">false</item>
<!-- was 12sp, which is too small for me in mixed case -->
<item name="android:textSize">16sp</item>
I hope this will be useful for someone ...
gvi70000 <gvi70000@gmail.com>: Jul 29 12:04AM -0700

Solved by using this tutorial
On Thursday, July 23, 2015 at 9:09:07 PM UTC+2, gvi70000 wrote:
gvi70000 <gvi70000@gmail.com>: Jul 28 11:51PM -0700

Hello all,
In my application i have a SlidingTabLayout, each tab containing a
listview. when i go through the tabs several times the items are added in
the listview each time. how can i prevent this behaviour?
the second question
On each tab i want to add a second fragment that will hold some controls,
each fragment has to be linked with a list item from the list view, when i
switch the tab the first list item has to be selected to display the
corresponding fragment. How can i achieve this behavior?
my main activity
public class MainActivity extends AppCompatActivity {
Toolbar toolbar;
ViewPager viewPager;
ViewPagerAdapter viewPagerAdapter;
SlidingTabLayout slidingTabLayout;
CharSequence Titles[] = {"Basic", "Sensors", "USB"};
int Numboftabs = 3;
protected void onCreate(Bundle savedInstanceState) {
// Creating The Toolbar and setting it as the Toolbar for the
toolbar = (Toolbar) findViewById(R.id.tool_bar);
// Creating The ViewPagerAdapter and Passing Fragment Manager,
Titles for the Tabs and Number Of Tabs.
viewPagerAdapter = new
ViewPagerAdapter(getSupportFragmentManager(), Titles);
// Assigning ViewPager View and setting the adapter
viewPager = (ViewPager) findViewById(R.id.pager);
// Assiging the Sliding Tab Layout View
slidingTabLayout = (SlidingTabLayout) findViewById(R.id.tabs);
slidingTabLayout.setDistributeEvenly(true); // To make the Tabs
Fixed set this true, This makes the tabs Space Evenly in Available width
// Setting Custom Color for the Scroll bar indicator of the Tab View
SlidingTabLayout.TabColorizer() {
public int getIndicatorColor(int position) {
return getResources().getColor(R.color.tabsScrollColor);
// Setting the ViewPager For the SlidingTabsLayout
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
return super.onOptionsItemSelected(item);
my view pager adapter
public class ViewPagerAdapter extends FragmentPagerAdapter {
CharSequence Titles[]; // This will Store the Titles of the Tabs which
are Going to be passed when ViewPagerAdapter is created
int NumbOfTabs; // Store the number of tabs, this will also be passed
when the ViewPagerAdapter is created
FragmentManager fragmentManager;
private static final int tabIcons[] = {R.drawable.hand,
R.drawable.sensors, R.drawable.fastobjects, R.drawable.gears,
// Build a Constructor and assign the passed Values to appropriate
values in the class
public ViewPagerAdapter(FragmentManager fm, CharSequence mTitles[]) {
this.fragmentManager = fm;
this.Titles = mTitles;
this.NumbOfTabs = mTitles.length;
//This method return the fragment for the every position in the View
public Fragment getItem(int position) {
Fragment fragment =
fragmentManager.findFragmentByTag("android:switcher:" + R.id.pager + ":" +
if (fragment == null) {
Bundle arguments = new Bundle();
arguments.putInt("position", position);
arguments.putString("frag","android:switcher:" + R.id.pager +
":" + position);
fragment = new Tab_Modes();
return fragment;
return null;
// This method return the titles for the Tabs in the Tab Strip
public CharSequence getPageTitle(int position) {
return Titles[position];
// This method return the Number of tabs for the tabs Strip
public int getCount() {
return NumbOfTabs;
and my listview creator
public class Tab_Modes extends ListFragment {
private ArrayList<NameImg> items = new ArrayList<NameImg>();
private int crtMode;
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View v = super.onCreateView(inflater, container,
Bundle arguments = getArguments();
crtMode = arguments.getInt("position");
Toast.makeText(getActivity(), "Crt Frag :" +
arguments.getString("frag"), Toast.LENGTH_LONG).show();
switch (crtMode) {
case 0:
items.add(new NameImg("Manual", "Simple camera Control",
items.add(new NameImg("Bulb", "Long Exposure",
items.add(new NameImg("Time Lapse", "Frame by Frame Movie",
items.add(new NameImg("HDR", "High Dinamic Range",
items.add(new NameImg("IR", "Infra RED Control",
case 1:
items.add(new NameImg("Triggered", "Trigger camera ",
items.add(new NameImg("Dark Room", "Long Exposure",
items.add(new NameImg("Lightning", "Frame by Frame Movie",
case 3:
items.add(new NameImg("1", "USB1", R.drawable.usb));
items.add(new NameImg("2", "USB2", R.drawable.waterdrops));
setListAdapter(new ModesItemAdapter(getActivity(), items));
//ListView myLV = null;
//myLV = (ListView) myLV.findViewById(R.id.customListView);
//myLV.setItemChecked(0, true);
return v;
public void onListItemClick(ListView l, View v, int position, long
id) {
super.onListItemClick(l, v, position, id);
//Toast.makeText(getActivity(), "selected item :" + position +
" ID :" + id, Toast.LENGTH_LONG).show();
FragmentManager fm = getFragmentManager();
ModeControls myControls;
myControls = (ModeControls) fm.findFragmentByTag(position +
"ModesContent" );
if (myControls == null) {//if the fragment dosen't exists we
create it
Bundle arguments = new Bundle();
arguments.putString("myTxt", "selected item :" + position +
" ID :" + id);
FragmentTransaction ft = fm.beginTransaction();
myControls = new ModeControls();
ft.add(R.id.main_activity, myControls).commit();
and my modes adapter - for my data structure
public class ModesItemAdapter extends ArrayAdapter<NameImg> {
public ModesItemAdapter(Context c, List<NameImg> items) {
super(c, 0, items);
public View getView(int position, View convertView, ViewGroup parent) {
ItemView itemView = (ItemView)convertView;
if (null == itemView)
itemView = ItemView.inflate(parent);
return itemView;
Terry <terboel@gmail.com>: Jul 28 11:32PM -0700

We have just received an email from Google, with info about their new Ads
I am afraid that I do not understand much of it, and I know that trying to
ask Google is a waste of time.
So I am trying to ask here instead. I am also sure that other developers
have the same questions.
We have a few apps with normal AdMob Banner Ads.
- Do our Ads use AdSense?
- Do our Ads use DoubleClick?
- Do our Ads use Cookies?
- (Are we supposed to know these things?)
- Do *we *have to do anything to comply with this new policy?
- (Why cannot Google be clearer about this and spell out what we have to do
- instead of using their usual vague formulations?)
Any help is appreciated.
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to android-developers+unsubscribe@googlegroups.com.

[android-developers] Digest for android-developers@googlegroups.com - 2 updates in 2 topics

Comments: (0)
Simon Giddings <mr.s.giddings@gmail.com>: Jul 28 09:35AM -0700

I have developed an application which contains this app theme style :
<style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar" />
I have tried various means to change the actionbar text to be mixed case
instead of all uppercase.
To illustrate, here is a screen shot -
The styles I have tried thus far have produced anything but the desired
How do I restyle just the letter case of these items ?
Tomas Prochazka <tomas.prochazka@gmail.com>: Jul 28 07:22AM -0700

Can you somebody explain me why *play-services-location* has depency on
It doesn't make sense. If you want only get position you don't need whole
map rendering core, it something like 2000 methods in the map package.
In reverse way it make sense. Map must have dependency on location, but why

You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to android-developers+unsubscribe@googlegroups.com.

[android-developers] Digest for android-developers@googlegroups.com - 1 update in 1 topic

Comments: (0)
Sheng-Dean <littledot5566@gmail.com>: Jul 26 02:52AM -0700

I often find myself duplicating the exact same set of test classes such as
mocks or helpers for both Android Tests `/androidTest` and Unit Tests
`/test` when writing tests for an application module.
For example, I have some static functions that help me set up mocks quickly
in `/test/MockUtils.java` However, I cannot reuse this helper class in any
of my AndroidTests because they do not share the same class path -
`/androidTest` vs `/test`.
I've thought of creating a new module that only contains test resources.
However, this idea won't fly because the Android Gradle plugin refuses to
depend on an app module.
project testCommon resolves to an APK archive which is not supported as
a compilation dependency.
Is there any other way to create test classes that could be reused in both
Android Tests and Unit Tests?
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to android-developers+unsubscribe@googlegroups.com.