Back button from "default share intent" exits application - Android - back-stack

i start a share intent from a drawer menu as below:
Intent iFriends = new Intent(Intent.ACTION_SEND);
iFriends.setType("text/plain");
iFriends.putExtra(Intent.EXTRA_TEXT, "http://www.liveplus.mobi");
iFriends.createChooser(iFriends, "Invite Friends");
startActivity(iFriends);
This drawer is on the MainActivity of the application.
when i press the back button, the application exits.
i want it to return to the MainActivity.

You are probably using android:noHistory="true" in your Manifest / MainActivity definitions. Remove it and back button will work properly.

Related

Back button in modal NavigationPage

My application presents a page, wrapped within a NavigationPage as a modal as part of a workflow process within the app.
I would like to add a platform specific "Back" button (UWP back arrow in title bar, "Back" text in iOS), i.e. the normal navigation behaviour you would see if an additional page was pushed on to the stack, which closes the modal and returns to the main application page.
Can this be done?

'Close' button in Storyboard won't link to IBAction in view controller.swift to dismiss a window

Hello all you smart people! I am very new to Xcode 8 and Swift3, and am bringing a new meaning to the phrase 'killer app'. It'll kill me before it gets a chance to provide my pension!!! :-)
My OSX app is a stay resident app in the top right of the apple menu (info.plist set to Application is Agent(UIElement)= True). The main function of the app, executing an applescript, works fine. It is run from the app menu icon or key combo. I've added an 'about' window and the window appears if I select 'about' from the App menu and it closes if I click the red circle. However I can't seem to get an (interface) close button to close the window.
The 'about' window is generated from an NSMenuItem in AppDelegate.swift as in the code below. All I'm trying to do is close said window with a close button in the (viewcontroller)interface. It's that simple but no matter what I try I cannot link the close button in the Storyboard viewcontroller to an IBAction in viewcontroller.swift so as to add window!.close. The only option given is a 'represented object' binding. It's not possible to link to an IBAction in AppDelegate.swift either.
t must be something to do with the way the window is generated because if I build an app with a normal apple menu the interface buttons will link to actions in the code. If anyone can help please email me at pauljvallance#icloud.com and I can send you the Xcode 8.2.1 project and Swift3 code. Best regards, Paul
func windowAbout(sender: NSMenuItem){
let mainStoryboard = NSStoryboard.init(name: "Main", bundle: nil)
myWindowController = mainStoryboard.instantiateController(withIdentifier: "aboutWindowController") as!
NSWindowController
myWindowController.showWindow(self)
}
Xcode 8 appears to have introduced a bug that prevents you from making connections by dragging from an Interface Builder element to a view controller method when the method in question is defined in a class extension. You can however create the desired connection by dragging from your method to the relevant UI element in Interface Builder:

Sencha Touch - Windows Phone 8 Phonegap Application Bar not hiding on back button click

We are developing an hybrid mobile application using Sencha touch 2 for Windows Phone 8.
While developing we noticed that for a number field in windows phone 8 there is no keyboard done button available.Please refer to the below screenshot.
We then decided to write a custom application bar in Windows Phone 8 - Phonegap application inside the MainPage.cs with an Done button inside that application bar.Please refer to the below screenshot.
Now the done functionality works fine but when we click on the back button of the device the keyboard hides but the application bar remains in the view as in the below screenshot
We tried overriding the back button functionality in phonegap, but when the keyboard is shown the back button click is fired only the second click ,the first click hides the keyboard and the second click fires the overridden function.
Can someone provide some alternatives or a solution on how to hide the custom application bar along with the keyboard when the back button is clicked the first time ?
In MainPage.xaml.cs add listener mentioned below which listens the event when back button is pressed in device when keypad is opened.
And pass a string from java script when ur calling particular plugin to show the application bar contains done button, by using that you can identify in which case you have to show and other case you can hide the bar.
cordova.exec(null, null, "Cordova.Extension.Commands.DoneButtonPlugin", "keyboardDoneShow", "Num");
cordova.exec(null, null, "Cordova.Extension.Commands.DoneButtonPlugin", "keyboardDoneHide", "input string");
private void CordovaView_LayoutUpdated(object sender, EventArgs e)
{
if (CordovaView.Content.DesiredSize.Height == 0)
{
if(App.appBar.IsVisible)
App.HideShell();
}
else
{
if (App.NumKey == "\"Num\"") {
if(!App.appBar.IsVisible)
App.ShowShell();
}
}
}

What is the hype around the Windows Phone 8 back button?

I know how to implement the back button. My question is about the desired behaviour (as I experienced there is a hype around it that the good implementation of back button is required to sell the app in the store).
There is the official source:
http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff402536(v=vs.105).aspx#BKMK_BackButton
But I have never used a WP8 for more than 5 minutes. I understood that the "Windows" button/key is the same as android home and ios home buttons. Is it true, that the WP8 back should be the same as the android back? (Briefly navigate back through pages (screens/activities), dismiss alerts or cancel confirm popups, or if it is the first/only/final page/activity, the app should exit.)
As I experienced, there is a long-press on the back button, which brings up the app switcher (~ios double home). Is it true that I should not take care about of this button? Is the default behavoiur the same for the remaining buttons (windows, power off, camera (half and full), search)? Should I override them? Can I override them (I think I can use camera, but can I use volume controls for other purposes)?
The certification requirements lay out what the back button should do pretty well. In short, it sounds like how you described the Android back button - here are the relevant requirements:
(5.2.4.1) Pressing the Back button must return the app to the previous page or return to any previous page within the back stack.
(5.2.4.2) Pressing the Back button from the first screen of an app must close the app.
(5.2.4.3) If the current page displays a context menu or a dialog, the pressing of the Back button must close the menu or dialog and return the user to the screen where the context menu or dialog box was opened.
You don't have to handle triggering the long-press, nor do you need to handle navigation specifically (assuming you're using the NavigationService for page navigation.)
You can definitely override the camera button, but search, power, and volume are off limits.

BlackBerry - Disable show default menu on screen open

I have labels and fields in my application screen. When i launch to a particular screen which has many labels and editfields and buttons. The problem is, when i launch a particular screen, default menu is popping up with "Show Keyboard", "Switch Applicaiton" and "Full menu" automatically when launching a particular screen. I don't want to get this menu when launching a screen. How do i ignore showing it? How to do that. Please advice.
Note: Eventhough there is no controls in the same screen, Menu is still popping up this.
Thanks.
If you're using a ButtonField to launch the new screen, make sure you add the ButtonField.CONSUME_CLICK style to its constructor so that the click event is not passed on down to the screen.

Resources