Tag: android-activity

How I can make an intro logotype animation like skype app?

I want to question if someone knows how I can make an intro logotype animation like as the skype app? I try to do an animation with an XML with looped images, but it is shown really weird. Someone can tell me an advice? Thank you for all. P.D.: I mean to make an animation […]

Activity onNewIntent Null Pointer Exception

I initialize my lists in my activity onCreate() like below: private List<MyItem> filtered; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_dashboard); filtered = new ArrayList<>(); // more things } And when i try to use filtered items from onNewIntent sometimes i get a null pointer exception. @Override protected void onNewIntent(Intent intent) { super.onNewIntent(intent); filtered.clear(); […]

Why overridePendingTransition does not take effect when I jump from Fragment to a new Activity?

The first activity contains a Fragment, and there’s a button inside the fragment, and when I click this button, I wish to jump to a new Activity with different animation. So I do it like this in the Fragment: mButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(getActivity(), NewActivity.class); getActivity().startActivity(intent); […]

Android Arbitrarily Nested ListView Type Menu

I want to create something like this: That is, a menu which I can feed an arbitrarily nested tree of strings to which will then lead to an activity who has access to the selected item. Should I create an activity class TreeSelectActivity then pass it a List<TreeNode> in a bundle and then recursively create […]

What is the 'best practice' for changing from 'Activities' to 'Fragments' for Android applications?

I am writing an application for Android platform. The application is already almost written for 2.x version, but I want to make it also for Honeycomb version. As you know, Honeycomb has ‘Fragments’ rather than ‘Activities’ for tab target. There is about 30 activities in my application and it must be changed to fragments. It […]

Android Parcelable Implementation with ArrayList<Object>

so I am implementing a test app in which I will create a Tournament object as Parcelable and will pass them between intents. A tournament include: . A tournament name . Rule . Rule for matching players (random/manual) . An array list of Players This is what I have so far: Tournament.java public class TournamentData […]

iOS equivalent of launching an Activity in Android

I just got done writing an Android Activity that allows other Activities to call it for some result (it’s not intended to be a stand-alone Activity). I’m now working on the equivalent iOS application and can’t find any resources for how I would enable similar functionality on iOS. The situation: The tool I’m producing is […]

Keep screen on in Activity – does not work with FLAG_KEEP_SCREEN_ON

So, for a long time I thought that I knew how to stop the screen from going into sleep mode, I simply used this code in my Activity: getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); However, I realized that this only worked when my phone was in “developer mode”, ie when the usb debugging (Settings –> Developer options –> USB debugging) […]

Retrieving only images from gallery when firing android image chooser intent

I am allowing the user to select an image from the device using the following code: (from this post) public class BrowsePicture extends Activity { private static final int SELECT_PICTURE = 1; private String selectedImagePath; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); ((Button) findViewById(R.id.Button01)) .setOnClickListener(new OnClickListener() { public void onClick(View arg0) { // in onCreate […]

Reload current Activity clicking on active Tab

i have a Tab Layout and the Activities are displayed in a frameLayout. How can i reload the current Activity from Tab “Home” by clicking again on “Home”-Tab ? TabTestActivity-class public class TabTestActivity extends TabActivity implements OnClickListener{ TabHost tabHost; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.