How to change generated activity title? - android

I have created a simple bar code generator using XZing library.
to do it I used a code :
Intent intent = new Intent("com.google.zxing.client.android.ENCODE");
intent.putExtra("ENCODE_FORMAT", "UPC_A");
intent.putExtra("ENCODE_DATA", "12345678901");
startActivity(intent);
I need to get rid of the title in this activity(grey bar in top of activity) ! Could you tell me how to do it ?
Image

this.requestWindowFeature(Window.FEATURE_NO_TITLE);
before the setContentView() in onCreate()in the Activity where you want to remove the titlebar.

You cannot change the title bar of someone else activity. If you have the source then you can used the above suggestion.

Related

How to hide notification bar of settings intent?

I am making an custom system setting application my goal is user can not see notification bar so i used this code its working fine.
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
but the problem is when i open settings intent from my app it shows notification bar i want to remove notification bar from this intent too how i can do this.
startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));
my device is rooted i am making my own launcher please guide me how i can do this.
sorry for poor English i tried my best to explain my problem
You can try using this:
Intent i = new Intent(Settings.ACTION_WIRELESS_SETTINGS);
i.putExtra(":android:show_fragment", "com.android.settings.wifi.WifiSettings");
i.putExtra(":android:no_headers", true);
startActivity(i);

How to add paragraphs, images to an android application?

I am creating a simple application for a college. I have added menu items. Now I want to add paragraphs, images to as a new page content on menu click. I have created an intent for the menu item. Now further what to do?
Please help me in doing this.
Use intent to pass to the next activity
Intent intent = new Intent(getApplicationContext(), Yourclass.class);
startActivity(intent);
Use this tutorial http://www.androidhive.info/2011/08/how-to-switch-between-activities-in-android/

How to open an Activity from Slideout in Android?

I downloaded from Android.com an example of Navigation Drawer (I want to make a Slideout)
but, in that example when I click in a item of the slideout, this will open an image, so, How can i open an Activity instead of an image?
please help me.
Use this code on press ( Button press or whatever is relavant to you)
Intent intent = new Intent(Currentactivity.this,Activitytoopen.class);
startActivity(intent);
Here:
1) Currentactivity.this should be replaced with the class name you are currently on.
2) Activitytoopen.class should be replaced with the activity name you want to navigate to.
Try to use this codes
Intent i = new Intent(Activity.this,NextActivity.class);
startActivity(i);
overridePendingTransition(android.R.anim.slide_in_left, android.R.anim.slide_out_right);

how to remove statusbar animation when changing to fullscreen in Android

when i change my activity to fullscreen, the statusbar performs an
animation,but not disappear immediately. so how can i make the
statusbar disappear immediate ? if need to change framework , where is
it?
try android:theme="#android:style/Theme.NoTitleBar.Fullscreen" in the activity tag in your manifest file.
Edit:
Use requestWindowFeature(Window.FEATURE_NO_TITLE) in your onCreate() before you call setContentView () to set programmatically.
I have found solution.
we can out following code in activity from which we are creating and starting Intent
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
Intent scanIntent = new Intent(this, SecondActivity.class);
startActivity(scanIntent);
By this it will hide status bar first then it will move to next activity.
Above code will require only when you are using single instance for second activity.
else you can apply solution given by Vineet Shukla

How to set Intent result in Layout

friend's,
I there any possibility to bind the result of Intent class in xml layout,
i'm doing it so for sending mail,i'm using below code for sending mail in
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
sendIntent.putExtra(Intent.EXTRA_EMAIL,
new String[] { "info#blacksheep.com" });
sendIntent.setType("vnd.android.cursor.dir/email");
when i use the above code it opens a new page,but i need it to be in the layout alone.
How can i get it.
Thanks in advance.
when i use the above code it opens a new page,but i need it to be in the layout alone. How can i get it.
You cannot do that, sorry. You are opening an activity from another application (whatever the user chooses to handle your ACTION_SEND request) -- it controls the presentation, not you.

Categories

Resources