I was able to figure out a way to achieve my requirement of having a
password entered whenever my app has been triggered from another
application.Basically extend this class except for my lancher activity.
public abstract class BaseActivity_old extends Activity {
boolean isCreated = false;
protected abstract void setLayout();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
isCreated = true;
}
@Override
public void onBackPressed() {
// TODO Auto-generated method stub
Log.d("BaseActivity", "this is onBackPressed");
setResult(RESULT_OK, getIntent());
finish();
super.onBackPressed();
}
@Override
protected void onResume() {
// TODO Auto-generated method stub
super.onResume();
if (isCreated) {
isCreated = false;
setLayout();// my app specific imple.. app is called from my own application
return;
}
if (hasNavigatedFromAppBackButton) {
Log.d("BaseActivity", "this is called from my application");
setLayout();// my app specific imple
} else {
setValidationLayout();
Log.d("BaseActivity", "this is not called from my application");
}
hasNavigatedFromAppBackButton = false;
}
private void setValidationLayout() {
///my app specific imple
}
protected void callMyAppActivity(Intent intent) {
intent.putExtra("my_app", true);
startActivityForResult(intent, 123);
}
boolean hasNavigatedFromAppBackButton = false;
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent
data) {
// TODO Auto-generated method stub
hasNavigatedFromAppBackButton = true;
Log.d("BaseActivity", "onActivityResult " + requestCode);
super.onActivityResult(requestCode, resultCode, data);
}
}
On Mon, Jan 23, 2012 at 10:29 PM, Mark Murphy <[email protected]>wrote:
> On Mon, Jan 23, 2012 at 11:24 AM, uday kiran jandhyala
> <[email protected]> wrote:
> > So far in Android, there is no way we could query WindowManager to
> > retrieve a list of titles of all such "Windows"...
> > Is this statement right?
>
> Correct.
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://github.com/commonsguy
> http://commonsware.com/blog | http://twitter.com/commonsguy
>
> Android App Developer Books: http://commonsware.com/books
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en