developer

LogCat message: The Google Play services resources were not found. Check your project configuration to ensure that the resources are included

Question: ❓❓❓ I have an application that uses the Google Maps Android v2 API. I’ve added the google-play-services_lib library project to my workspace and added a reference to it from my application project, following the instructions on these pages: http://developer.android.com/google/play-services/setup.html. https://developers.google.com/maps/documentation/android/start Everything seems to work fine: The app displays maps Read more…

By admin, ago
developer

Running the new Intel emulator for Android

Question: ❓❓❓ Lately Google and Intel have published a new way to run the emulator, which should work much better than the previous version (which has emulated ARM CPU). Here are some links about it: this and this. However, after installing the new components and creating a new emulator configuration Read more…

By admin, ago
developer

Fragment MyFragment not attached to Activity

Question: ❓❓❓ I’ve created a small test app which represents my problem. I’m using ActionBarSherlock to implement tabs with (Sherlock)Fragments. My code: TestActivity.java public class TestActivity extends SherlockFragmentActivity { private ActionBar actionBar; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setupTabs(savedInstanceState); } private void setupTabs(Bundle savedInstanceState) { actionBar = getSupportActionBar(); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); Read more…

By admin, ago
developer

Android changing Floating Action Button color

Question: ❓❓❓ Been trying for hours to change Material’s Floating Action Button color, but without success. <android.support.design.widget.FloatingActionButton android:id="@+id/profile_edit_fab" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="end|bottom" android:layout_margin="16dp" android:clickable="true" android:src="@drawable/ic_mode_edit_white_24dp" /> I have tried to add android:background="@color/mycolor" or via code FloatingActionButton fab = (FloatingActionButton) rootView.findViewById(R.id.profile_edit_fab); fab.setBackgroundColor(Color.parseColor("#mycolor")); or fab.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#mycolor"))); But none of the above worked. I Read more…

By admin, ago
developer

How can I write character & in android strings.xml

Question: ❓❓❓ I wrote the following in the strings.xml file: <string name="game_settings_dragNDropMove_checkBox">Move by Drag&Drop</string> I got the following error: The reference to entity "Drop" must end with the ';' delimiter. How can I write character & in the strings.xml? Good Answer: 👌👌👌 Encode it: &amp; Read More: 👉 https://stackoverflow.com/questions/3053062/how-can-i-write-character-in-android-strings-xml

By admin, ago
developer

How do I restart an Android Activity

Question: ❓❓❓ How do I restart an Android Activity? I tried the following, but the Activity simply quits. public static void restartActivity(Activity act){ Intent intent=new Intent(); intent.setClass(act, act.getClass()); act.startActivity(intent); act.finish(); } Good Answer: 👌👌👌 I did my theme switcher like this: Intent intent = getIntent(); finish(); startActivity(intent); Basically, I’m calling Read more…

By admin, ago