First Activity for apply Terms and ConditionsHow do save an Android Activity state using save instance state?Activity restart on rotation AndroidStop EditText from gaining focus at Activity startupRemoving an activity from the history stackHow do I pass data between Activities in Android application?Activity has leaked window that was originally addedHow to avoid history of activityYou need to use a Theme.AppCompat theme (or descendant) with this activityHow display Activity from Notification without display the Root Activity?How to open Terms And Conditions “ACTIVITY ” (NOT DIALOG BOX) in Android studio?
How to back up a running Linode server?
Hang 20lb projector screen on Hardieplank
Short story about people living in a different time streams
Would "lab meat" be able to feed a much larger global population
Can fracking help reduce CO2?
Map one pandas column using two dictionaries
Field Length Validation for Desktop Application which has maximum 1000 characters
An 'if constexpr branch' does not get discarded inside lambda that is inside a template function
What happened to Ghost?
You look catfish vs You look like a catfish?
Has any spacecraft ever had the ability to directly communicate with civilian air traffic control?
LT Spice Voltage Output
Packet sniffer for MacOS Mojave and above
If Earth is tilted, why is Polaris always above the same spot?
Pressure to defend the relevance of one's area of mathematics
Accidentally deleted the "/usr/share" folder
Is lying to get "gardening leave" fraud?
Feels like I am getting dragged into office politics
Topological Spaces homeomorphic
Password expiration with Password manager
Applying a function to a nested list
What is the most remote airport from the center of the city it supposedly serves?
Disabling Resource Governor in SQL Server
Selecting a secure PIN for building access
First Activity for apply Terms and Conditions
How do save an Android Activity state using save instance state?Activity restart on rotation AndroidStop EditText from gaining focus at Activity startupRemoving an activity from the history stackHow do I pass data between Activities in Android application?Activity has leaked window that was originally addedHow to avoid history of activityYou need to use a Theme.AppCompat theme (or descendant) with this activityHow display Activity from Notification without display the Root Activity?How to open Terms And Conditions “ACTIVITY ” (NOT DIALOG BOX) in Android studio?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I want to build Terms and Conditions dialog display on a "startActivity". If the user clicked on the Accept button or clicked on a Checkbox, it start the app with MainActivity. But later, on second/third etc. start, i will skip the "startActivity", i will run the app direkt with the MainActivity. (if the user clicked earlier on the Accept button). How can this be solved?
Thanks!
android
add a comment |
I want to build Terms and Conditions dialog display on a "startActivity". If the user clicked on the Accept button or clicked on a Checkbox, it start the app with MainActivity. But later, on second/third etc. start, i will skip the "startActivity", i will run the app direkt with the MainActivity. (if the user clicked earlier on the Accept button). How can this be solved?
Thanks!
android
add a comment |
I want to build Terms and Conditions dialog display on a "startActivity". If the user clicked on the Accept button or clicked on a Checkbox, it start the app with MainActivity. But later, on second/third etc. start, i will skip the "startActivity", i will run the app direkt with the MainActivity. (if the user clicked earlier on the Accept button). How can this be solved?
Thanks!
android
I want to build Terms and Conditions dialog display on a "startActivity". If the user clicked on the Accept button or clicked on a Checkbox, it start the app with MainActivity. But later, on second/third etc. start, i will skip the "startActivity", i will run the app direkt with the MainActivity. (if the user clicked earlier on the Accept button). How can this be solved?
Thanks!
android
android
asked Mar 22 at 20:04
Bálint PolgárBálint Polgár
32
32
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Use SharedPreferences to store and access the user's response. https://developer.android.com/training/data-storage/shared-preferences#java
SharedPreferences sharedPref =
getActivity().getPreferences(Context.MODE_PRIVATE);
String res=sharedPref.getString("UserResponse","NONE");
if(res.equals("Acccept"))
//goto main activity here
//get user response into String response
SharedPreferences.Editor editor = sharedPref.edit();
editor.putInt("UserResponse", response);
editor.commit();
Thanks, it works. I have Firebase in the app. And how can i disable the Firebase from Activity? If Sharedpreference result is false (its a boolean).
– Bálint Polgár
Mar 25 at 6:12
add a comment |
You just need to:
Make sure your main activity is the one system starts
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>In your Main activity check if user has already accepted terms or no. If no, drive him to TnC activity.
Obviously state of TnC acceptance must be stored somewhere (preferences, room, firebase etc).
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55307071%2ffirst-activity-for-apply-terms-and-conditions%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Use SharedPreferences to store and access the user's response. https://developer.android.com/training/data-storage/shared-preferences#java
SharedPreferences sharedPref =
getActivity().getPreferences(Context.MODE_PRIVATE);
String res=sharedPref.getString("UserResponse","NONE");
if(res.equals("Acccept"))
//goto main activity here
//get user response into String response
SharedPreferences.Editor editor = sharedPref.edit();
editor.putInt("UserResponse", response);
editor.commit();
Thanks, it works. I have Firebase in the app. And how can i disable the Firebase from Activity? If Sharedpreference result is false (its a boolean).
– Bálint Polgár
Mar 25 at 6:12
add a comment |
Use SharedPreferences to store and access the user's response. https://developer.android.com/training/data-storage/shared-preferences#java
SharedPreferences sharedPref =
getActivity().getPreferences(Context.MODE_PRIVATE);
String res=sharedPref.getString("UserResponse","NONE");
if(res.equals("Acccept"))
//goto main activity here
//get user response into String response
SharedPreferences.Editor editor = sharedPref.edit();
editor.putInt("UserResponse", response);
editor.commit();
Thanks, it works. I have Firebase in the app. And how can i disable the Firebase from Activity? If Sharedpreference result is false (its a boolean).
– Bálint Polgár
Mar 25 at 6:12
add a comment |
Use SharedPreferences to store and access the user's response. https://developer.android.com/training/data-storage/shared-preferences#java
SharedPreferences sharedPref =
getActivity().getPreferences(Context.MODE_PRIVATE);
String res=sharedPref.getString("UserResponse","NONE");
if(res.equals("Acccept"))
//goto main activity here
//get user response into String response
SharedPreferences.Editor editor = sharedPref.edit();
editor.putInt("UserResponse", response);
editor.commit();
Use SharedPreferences to store and access the user's response. https://developer.android.com/training/data-storage/shared-preferences#java
SharedPreferences sharedPref =
getActivity().getPreferences(Context.MODE_PRIVATE);
String res=sharedPref.getString("UserResponse","NONE");
if(res.equals("Acccept"))
//goto main activity here
//get user response into String response
SharedPreferences.Editor editor = sharedPref.edit();
editor.putInt("UserResponse", response);
editor.commit();
edited Mar 22 at 20:24
answered Mar 22 at 20:16
Sandeep PolamuriSandeep Polamuri
4387
4387
Thanks, it works. I have Firebase in the app. And how can i disable the Firebase from Activity? If Sharedpreference result is false (its a boolean).
– Bálint Polgár
Mar 25 at 6:12
add a comment |
Thanks, it works. I have Firebase in the app. And how can i disable the Firebase from Activity? If Sharedpreference result is false (its a boolean).
– Bálint Polgár
Mar 25 at 6:12
Thanks, it works. I have Firebase in the app. And how can i disable the Firebase from Activity? If Sharedpreference result is false (its a boolean).
– Bálint Polgár
Mar 25 at 6:12
Thanks, it works. I have Firebase in the app. And how can i disable the Firebase from Activity? If Sharedpreference result is false (its a boolean).
– Bálint Polgár
Mar 25 at 6:12
add a comment |
You just need to:
Make sure your main activity is the one system starts
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>In your Main activity check if user has already accepted terms or no. If no, drive him to TnC activity.
Obviously state of TnC acceptance must be stored somewhere (preferences, room, firebase etc).
add a comment |
You just need to:
Make sure your main activity is the one system starts
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>In your Main activity check if user has already accepted terms or no. If no, drive him to TnC activity.
Obviously state of TnC acceptance must be stored somewhere (preferences, room, firebase etc).
add a comment |
You just need to:
Make sure your main activity is the one system starts
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>In your Main activity check if user has already accepted terms or no. If no, drive him to TnC activity.
Obviously state of TnC acceptance must be stored somewhere (preferences, room, firebase etc).
You just need to:
Make sure your main activity is the one system starts
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>In your Main activity check if user has already accepted terms or no. If no, drive him to TnC activity.
Obviously state of TnC acceptance must be stored somewhere (preferences, room, firebase etc).
answered Mar 22 at 20:15
rorror
582410
582410
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55307071%2ffirst-activity-for-apply-terms-and-conditions%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown