Tag: android-activity

How to provide and handle deep links in cordova / phonegap applications

Hi I would like to know of a Cordova / Phonegap plugin or way to expose and handle deep-links in my Sencha Touch / Cordova App So far I am able to deep-link into other applications lets say open Google Play to a specific app detail page. Using this plugin https://github.com/code4jhon/org.apache.cordova.startapp So what I would […]

Android: Setting onClickListener to a Part of text in a TextView – Issue

I am trying to recognise hashtags in my TextView and make them clickable such that I can take the user to another View when they click on the Hashtag. I managed to identify Hashtags in the TextView using Pattern Matching and they appear colored in Runtime. However, I need to make the Hashtag clickable. Here’s […]

Closing activities stack after a button click

In my app, I start an eight step “wizard” from my landing page in which data is passed from step 1 all the way to step 8. For keeping the data intact while still in between steps, I am not calling finish() on either of the activities. However, when all the steps are complete, is […]

Service and a BroadCastReceiver

I have seen several examples of how to implement a BroadCastReceiver, but how should I implement a Service that has to react to some pending Intent (for example incoming phone call)… Actually I was wondering about the same “problem” but in an Activity.. You obviously have a class which extends a Service or an Activity) […]

How to specify which activity starts on app launch?

I have an app with 3 different activities in it. When I launch the app one of the activities always starts first. But I want a differnt activity to start before the one that is currnetly starting first. How would I change this to make a differnet activity start first?

Determine backstack fragment empty state in android

My application structure look like: SplashActivity -> MainActivity -> (switching between many fragments) What I expect: finish application from main activity when fragment back stack count is zero. Here is my try: In SplashAcitivty public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (getIntent().getBooleanExtra(“exit”, false)) { finish(); } } In MainActivity: @Override public void onBackPressed() { // […]

How do I bind this service in Android?

This is the code in my Activity. Initiate an Intent, then a Connection, right? hello_service = new Intent(this, HelloService.class); hello_service_conn = new HelloServiceConnection(); bindService( hello_service, hello_service_conn, Context.BIND_AUTO_CREATE); But my question is…what goes inside the Connection? class HelloServiceConnection implements ServiceConnection { public void onServiceConnected(ComponentName className,IBinder boundService ) { } public void onServiceDisconnected(ComponentName className) { } }; […]

How to get all Views in an Activity?

is there a way to get every view that is inside my activity? I have over 200 views including buttons, and images, so i want to be able to access them by using a loop for example something like for (View v : this) { //do something with the views //depending on the types (button, […]

ActionBarSherlock: OnOptionsItemSelected doesn't recognize R.id.home

I’m using the ActionBarSherlock library and I’m following the exact steps as suggested here and here to enable navigation to the previous screen. My code looks like this: getSupportActionBar().setDisplayHomeAsUpEnabled(true); and @Override public boolean onOptionsItemSelected(MenuItem item) { // This callback is used only when mSoloFragment == true (see // onActivityCreated above) switch (item.getItemId()) { case android.R.id.home: […]

Android activity inside dialog

I want to start an activity inside a pop-up screen. Are there any suggestions for a quick change? new AlertDialog.Builder(SearchResults.this) .setTitle(“Refine”) .setItems(/*catNames*/, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { /* User clicked so do some stuff */ String catName = catNames[which]; String categoryIds = subCats.get(catName); }) .setNegativeButton(“Cancel”, new DialogInterface.OnClickListener() { public void […]

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