Android studio, after user click go to (A)page, restart apps will open (A) page - android-studio

i am beginner in Android Studio. I know there was a function called SharedPreferences, but i did not know how to use it.
Can anyone explain to me how to use it as i given the example above.

I didn't quite get what you said but here is as much as i know:
You first make a Sharedpreference Object and then a Sharedpreferemce editor object like this
Sharedpreference s=getApplicationContext().getSharedPreference("a name for your preference",and the mode that actually is zero 0);
Sharedpreference.Editor ed=s.Edit();
The rest is easy for editing values use ed.putboolean ,ed.putString ,ed.putInt and more and at last use ed.commit() or ed.Apply() to apply the changes you have made and for getting the values use s.getString
The concept is very easy Editor for editing and Sharedpreference for getting value
And at last when puting values the concept is like this
ed.putValue(key,value);
Key is the name and value is the value
And for getting keys the concept is like this
S.getValue(key,defvalue)
Key is the name of the variable that you saved value in it and the def value comes when that key is empty both are String types
And at last jf you are so new to android studio first learn basic things like lifecycle and much more it will help you alot.
Hope you get it
****EDITED**** but if you are talking about going to new activity from one activity that is not the Sharedpreference that is the Intent and startActivity by the way java hasn't got functions it has methods.

Related

Set Transaction Type to RETURN conditionally in maximo

In Work order tracking application in actuals tab materials section when user clicks on New row by default the transaction type = ISSUE . I would like to change this by default to RETURN and remove issue from the look up (I was able to remove ISSUE from the lookup). This requirement should only work for PM type work orders. Hence I tried to write an automation script on MATUSETRANS.ISSUETYPE attribute launch point however it throws null pointer expection which trying to perform setValue. I tried using 2L,7L and 11L however it doesn't work.
if(onadd) ==True:
mbo.setValue("ISSUETYPE",'RETURN')
Is there any other way to do this?
We basically need to trigger the code on a field that sets after ISSUETYPE is set using the out of the box code so I tried on field like currencycode or condrate (attribute launch point) and it works like charm. You will have to use 7L though to the existing code.

RPA Blueprism input collection in process studio action stage

Trying to parameterize a hotel booking page where we need to enter check in, check out details etc. I created a page in object studio with various action/navigation stages for that web page. Now I need to call that object in process and loop it with input collection. When I am calling that object studio page in process studio action stage, I can select my object and action from dropdown, but under inputs tab not getting any row to drag and drop the input collection that I have created, how to do this ?
Seems you should go take Blue Prism tutorial on their homepage, as this very basic, it's how to call another process/Business object.
Short description:
Create a process which is your main.
Create your functionality in a Business object.
From your process you will pull in an 'Action' block and find your
business object in the drop down.
When it comes to input/output. Click on Start/End
to create the Input/Output you need.
Hope this was helpful.
I'm not sure if I understand your problem correctly, but shouldn't you input your data in START step in proces studio?
So, in START step in proces studio you input data and then(whit that input) you go into actions from your object.
Hope it helps.
make sure you place your data items/collections which ever is output in run time object in END stage, and make sure you uncheck hide from process box.
In process you will be able to find necessary output from object and will involve in your rest action
hope this helps :)
You need to provide input parameters in the Start properties of your Object. Inputs to a page in Object Studio provide the means for a Process to supply data to the Business Object.
Essentially, the Business Object is saying to the Process, “What check in, check out details etc do you want me to work with?”.
Hope this helps.
I had the same issue, it is resolved!
When you create an Object and go to Application Modeller, make sure you choose "Browser Based Application" instead of Windows Based Application. I had selected Windows based applocation and it was not showing up in the Process Studio. I hope this

Visual State name in ViewModel Best Practice

I'm new to Windows Universal app programming. Decided to use Tmeplate10 to create my first app.
I would like to know what is best practice to get Current Visual state name in View Model.
In code behind XAML I have been using:
VisualState vs = AdaptiveVisualStateGroup.CurrentState;
if (vs != null)
{
string actualStateName = vs.Name
}
What is best way to get same thing in ViewModel?
Please don't try to mess around with the visual state in your view-model. Consider this, your view-model exists to handle the underlying data necessary for your view. This is NOT the same thing as presenting the data in your view. Your view, on the other hand, has the logic to present data - and to do it with different visual states based on certain triggers. Those triggers are visual triggers, not data triggers. For that reason, you should handle visual states in the view and the implicit code-behind of the view.
If the data impacts the view, like if the user logs out suddenly or something, then that, too, is a property (like IsLoggedIn) in your view-model that your view uses to change the visual state. If you are trying to get a reference to the visual state in your view-model then you are sort of short circuiting the intent of MVVM.
That being said, I am not the developer of your app, you are. And, the code you are showing is the only way to reliably get the current visual state. It is worth pointing out that more than one visual state can be active at one time across multiple visual state groups. How could you possibly run the code you provided without a direct reference of the visual state group class in your view-mode? How to get it there?
Page.OnNavigatedTo() { ViewModel.Group = AdaptiveVisualStateGroup; } is how.
But I hope you consider the rest of the answer.

Function import list is empty for Entity Framework 5.0

I've started work on an application that uses Entity Framework 5.0 and MVC 4 in VS 2012. The application connects to an existing database, so this is a database first site. So far things are working great. But I have a method i am writing that needs to use a function defined on the database side. Lets call it DoesItHaveAThingy(Guid id, string type), it returns a boolean. The function works fine, been working on this database for a few years.
So I open the edmx designer and right click then select Update Model From Database. I select my function and hit finish. It adds the funcion in Model.Store, you can see it in the model browser. Seems all good. Yet no code is generated.
I look about online and people say that once you have done that step you need to do Function Import. Ok, so i right click on the designer and hit Add -> Function import. It brings up the dialog where you an add your name for the function. The dialog also has a drop down list of functions, you need to select one. This is where the problem is, that drop down list is empty. So i can not import the function i need.
I'm guessing I am doing something wrong. I thought that maybe the emdx file added the function but with an error. I had that once with a view, checked the file, and near the view it had a comment stating the error for that view (it didnt have primary key, then again, what view does). But i didnt see any error message for the function, it seemed to be added ok.
Was it just that function? Nope, tried another function, same parameters yet returns an int. Same issue.
Thank you.

Get UniqueId of a list item from SPMetal code

Quick question. I want to generate code with SPMetal that includes the UniqueId field (the field that has the GUID for the list item), but somehow in Visual Studio I end up with either:
A list without that field
A list that in theory has that field (UniqueIdUniqueId.. why is it named that way?), but when I try to run it, throws me a NullException.
I'm using Sharepoint 2010, VS 2010.
Can you point me in the right direction? I'm stalled right now. I would paste you the XML file I've been using as parameters to SPMetal, but my servers are down right now. I'll post it ASAP, but if anyone has the answer on how to generate a class that includes that particular field, I'd be thankful.
Thanks!
The solution was: use the "GUID" hidden field. Duh.
I think is no way to include 'UniqueId', because is not a part of any content type.
If this realy need to get 'UniqueId', try write SQuery, which get item by ID with one viewField (to maximize performance).

Resources