How to disable home button and restore button - Android Q&A, Help & Troubleshooting

#ask
i with my team had developed android apps for exam, we have some problems how to disable home and restore button. we did success for back button but still force close after we touch it. so maybe anyone can help us to solve this problem.

You can disable home button by:
Code:
@Override
public void onAttachedToWindow() {
this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD);
super.onAttachedToWindow();
}

thanks..i will try

Related

[Q] How to disable power button in lock screen ?

Hi,
I managed to do it in SGS2 but with my tab 10.1 it didn't work ..
I edited the file sec_power_key.kl and removed the WAKE command from POWER.
the reason I want this is for security because I don't want any one to turn off the device if my tab is locked.
Thanks.
logic5 said:
Hi,
I managed to do it in SGS2 but with my tab 10.1 it didn't work ..
I edited the file sec_power_key.kl and removed the WAKE command from POWER.
the reason I want this is for security because I don't want any one to turn off the device if my tab is locked.
Thanks.
Click to expand...
Click to collapse
Without that key edit I am not sure. In source it could be done by doing something like:
Line 317:
https://github.com/CyanogenMod/andr...droid/internal/policy/impl/GlobalActions.java
That creates the list you see when its called. You could create an intent to override those default settings.
Code:
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) {
//screen locked
} else if (intent.getAction().equals(Intent.ACTION_SCREEN_ON)) {
//screen unlocked
}
}
Then you update the code in 317 to check the variable assigned at that public void. If true it wouldn't display that list, meaning phone locked. If false it would show that list meaning phone awake.
Other then that. I am not sure. I will let you know if I come up with anything else though.

Eclipse dev. please help

Hello, Im working on a applicatiopn that will help me and my friends in school with allot of things, and i have a problem programming a "on screen back button". later when i get home i will post the codes I´ve wrote so fare. (im not a skilld programmer so i gess i haven´t used the best codes)
I would be realy super happy if someone could help me out
Im working in eclipse and I have sucsesfully made a button to gett to a new View but when i press the back button on my S3 it closes the app and my on screen back button, I just can´t get it to work.
Please help me out!
Thanks
Fix
I found a way to fix my the problem
Button backButton = (Button)this.findViewById(R.id.back);
backButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
devise stock back button
this.dispatchKeyEvent(new Keyevent(ACTION_DOWN, KEYCODE_BACK));

[Q] Titanium Backup is missing the Menu button

{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
As you can see, its not where it normally is.. anyone know how to get this back?
I tried to follow this http://androidforums.com/evo-4g-lte-all-things-root/687330-titanium-backup-google-play-missing-menu-button-after-flashing-viper.html but I dont see this "settings> display, gestures & buttons."
The reason is because the restoring is not working as I need to change the backup location...
Im running PAC-man rom
gd6noob said:
As you can see, its not where it normally is.. anyone know how to get this back?
I tried to follow this http://androidforums.com/evo-4g-lte-all-things-root/687330-titanium-backup-google-play-missing-menu-button-after-flashing-viper.html but I dont see this "settings> display, gestures & buttons."
The reason is because the restoring is not working as I need to change the backup location...
Im running PAC-man rom
Click to expand...
Click to collapse
Go to settings->pac-> general UI->3 dot overflow
I have the same issue on CyanogenMod.
Musicbee said:
I have the same issue on CyanogenMod.
Click to expand...
Click to collapse
I have a workaround for you and anyone else on a custom ROM with this problem.
1. Enter the settings menu in your ROM.
2. Search for 'Hardware Buttons' On-Screen navigation buttons
3. Enable custom actions
3. Select the back/home key (normal/long press or double tap) and configure it to open a menu.
I have my home button setup with a long press to open a menu. I use this in Titanium Backup to open the menu and it works magically. I tried searching online with no solution to be had. Hope this works for you. Different ROM's have different layout but the same basic principles.
Your trying to customize your navigation bar keys (home/ back) with a single/double press or long press to open a menu.
This has been solved a long time ago, I don't recall exactly how :/
Titanium Backup Menu
This was not working with my Oneplus Two...
Solved after your suggestion.
Thank you so much!
0.02c said:
I have a workaround for you and anyone else on a custom ROM with this problem.
1. Enter the settings menu in your ROM.
2. Search for 'Hardware Buttons' On-Screen navigation buttons
3. Enable custom actions
3. Select the back/home key (normal/long press or double tap) and configure it to open a menu.
I have my home button setup with a long press to open a menu. I use this in Titanium Backup to open the menu and it works magically. I tried searching online with no solution to be had. Hope this works for you. Different ROM's have different layout but the same basic principles.
Your trying to customize your navigation bar keys (home/ back) with a single/double press or long press to open a menu.
Click to expand...
Click to collapse
JMC1961 said:
This was not working with my Oneplus Two...
Solved after your suggestion.
Thank you so much!
Click to expand...
Click to collapse
Thanks, it works
Sent from my AOSP on Z00A using Tapatalk
CM13 and Titanium Backup - no Menu Button
0.02c said:
I have a workaround for you and anyone else on a custom ROM with this problem.
1. Enter the settings menu in your ROM.
2. Search for 'Hardware Buttons' On-Screen navigation buttons
3. Enable custom actions
3. Select the back/home key (normal/long press or double tap) and configure it to open a menu.
I have my home button setup with a long press to open a menu. I use this in Titanium Backup to open the menu and it works magically. I tried searching online with no solution to be had. Hope this works for you. Different ROM's have different layout but the same basic principles.
Your trying to customize your navigation bar keys (home/ back) with a single/double press or long press to open a menu.
Click to expand...
Click to collapse
Thank you for the work around, which does work but am convinced that there is another way as it was working for a while on my OnePlus X and CM13. However something has stopped it working but I don't know what? I thought to start with it was the dpi as on the OxygenOS ROM this did make it appear.
Does anyone have any other ideas please?
0.02c said:
I have a workaround for you and anyone else on a custom ROM with this problem.
1. Enter the settings menu in your ROM.
2. Search for 'Hardware Buttons' On-Screen navigation buttons
3. Enable custom actions
3. Select the back/home key (normal/long press or double tap) and configure it to open a menu.
I have my home button setup with a long press to open a menu. I use this in Titanium Backup to open the menu and it works magically. I tried searching online with no solution to be had. Hope this works for you. Different ROM's have different layout but the same basic principles.
Your trying to customize your navigation bar keys (home/ back) with a single/double press or long press to open a menu.
Click to expand...
Click to collapse
Bit late but google search brought me here for the same problem for my Tab S2 and it worked lol, thanks
0.02c said:
I have a workaround for you and anyone else on a custom ROM with this problem.
1. Enter the settings menu in your ROM.
2. Search for 'Hardware Buttons' On-Screen navigation buttons
3. Enable custom actions
3. Select the back/home key (normal/long press or double tap) and configure it to open a menu.
I have my home button setup with a long press to open a menu. I use this in Titanium Backup to open the menu and it works magically. I tried searching online with no solution to be had. Hope this works for you. Different ROM's have different layout but the same basic principles.
Your trying to customize your navigation bar keys (home/ back) with a single/double press or long press to open a menu.
Click to expand...
Click to collapse
Thanks, you saved my day...
The workaround doesn't work on Lineage 15 Android Oreo 8. Any more ideas?
seva.lapsha said:
The workaround doesn't work on Lineage 15 Android Oreo 8. Any more ideas?
Click to expand...
Click to collapse
When I click on the “Problems?“ button on the first screen after start of the titanium, I am able to chose the settings in the neww windows that will pop up.
When I click on the “Problems?“ button on the first screen after start of the titanium, I am able to chose the settings in the new windows that will pop up.
Click to expand...
Click to collapse
That's it!!!
fehrcomp said:
When I click on the “Problems?“ button on the first screen after start of the titanium, I am able to chose the settings in the neww windows that will pop up.
Click to expand...
Click to collapse
gelrav said:
That's it!!!
Click to expand...
Click to collapse
That's only the preferences. The menu is different where you can backup/restore sms, call logs, and wifi ssids.
aeonix_05 said:
That's only the preferences. The menu is different where you can backup/restore sms, call logs, and wifi ssids.
Click to expand...
Click to collapse
You're totally right aeonix.
For anybody reading this, please reply if you're running a LineageOS version where the 'Menu' button is still present in TiBu.
I just installed LOS 20171106 on my OnePlus One and the 'Menu' button in TiBu is gone.
clutch2k3 said:
You're totally right aeonix.
For anybody reading this, please reply if you're running a LineageOS version where the 'Menu' button is still present in TiBu.
I just installed LOS 20171106 on my OnePlus One and the 'Menu' button in TiBu is gone.
Click to expand...
Click to collapse
my menu button came back after rebooting a few dozen times. BTW I'm running TiBu 8.1.0 pro.
thank you
fehrcomp said:
When I click on the “Problems?“ button on the first screen after start of the titanium, I am able to chose the settings in the neww windows that will pop up.
Click to expand...
Click to collapse
You Sir. Are a legend.
Clicking Problems button didn't help. I cannot see the settings button with LOS 14.1 on my S4 Mini.
As a workaround you can (on Oreo) go the system settings, and in system->buttons set a button action to open the menu. I used the home button double tap.

[Q] Xposed developing for 5.1 cm12.1

Hello
My phone is the moto x 2014 running CM12.1 nightly.
i was trying to learn how to develop modules for my rom using this tut.
Everything was fine using this code
Code:
package de.robv.android.xposed.mods.tutorial;
import static de.robv.android.xposed.XposedHelpers.findAndHookMethod;
import de.robv.android.xposed.IXposedHookLoadPackage;
import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam;
public class Tutorial implements IXposedHookLoadPackage {
public void handleLoadPackage(final LoadPackageParam lpparam) throws Throwable {
if (!lpparam.packageName.equals("com.android.systemui"))
return;
});
}
}
but when i add the hook method
Code:
findAndHookMethod("com.android.systemui.statusbar.policy.Clock", lpparam.classLoader, "updateClock", new XC_MethodHook() {
@Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
// this will be called before the clock was updated by the original method
}
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
// this will be called after the clock was updated by the original method
}
System UI crashes on startup and i need to reboot to recovery and disable xposed.
The Question​what is going wrong? is this tutorial outdated for 5.1 am i missing something?
logs are in attachement, for more info plz don't hesitate to ask.
Use latest build
http://forum.xda-developers.com/xposed/super-alpha-posted-permission-xposed-t3072979
For me it doesn't work.
I flashed the zip with twrp, the phone rebooted successfully but I can't find the xposed program from the app menu. Maybe I missed something?
I am on g3 with 5.1.1 cyanidel.
Thanks!
half cooked
Stefano Bottari said:
For me it doesn't work.
I flashed the zip with twrp, the phone rebooted successfully but I can't find the xposed program from the app menu. Maybe I missed something?
I am on g3 with 5.1.1 cyanidel.
Thanks!
Click to expand...
Click to collapse
Your food is half cooked....
After flashing it through twrp you have to install xposed 3.0 alpha apk .

How Do I Get ContentResolver Query To Check if Events Exists In The Calendar Or Not?

I need help with this code that I've been trying to figure out for hours. I know it's something close to what I have from my research, but I can't get it to work. Not even the codes provided from other posts on other sites. Any ideas?
public void checkEventsInCal() {
ContentResolver cr = getContentResolver();
Cursor cursor = cr.query(Uri.parse("content://com.android.calendar/events"), new String[]{"_id"}, "_id=?", new String[]{CalendarContract.Events.TITLE}, null);
if (cursor.moveToFirst()) {
Toast.makeText(this,"Event Exists!", Toast.LENGTH_SHORT).show();
}else {
Toast.makeText(this,"Event Doesn't Exist!", Toast.LENGTH_SHORT).show();
}
}
Thanks in advance for your help!!
Can I get a working solution please. Someone please respond. Thanks!

Categories

Resources