I want to pass string from one activity and compare that string value in 3rd 4th activity so I want to know how to pass value from one activity to another without starting that activity. I know intent way by using startActivity(intent) I don't want to start activity. Please help.
            Asked
            
        
        
            Active
            
        
            Viewed 523 times
        
    -6
            
            
         
    
    
        SMR
        
- 6,628
- 2
- 35
- 56
 
    
    
        Kashaf Ahmed
        
- 67
- 2
- 10
- 
                    http://stackoverflow.com/a/2098936/1992254 – Tejas May 19 '16 at 05:11
- 
                    if you do not want to start activity how your values will be initialized – Muhammad Younas May 19 '16 at 05:11
- 
                    You need to explain more why you dont want to start activity immediately. Do you want to start it later? what is your use case? Please explain more in detail. – SMR May 19 '16 at 05:12
- 
                    i want to start it later but not from that activity from which i want string values – Kashaf Ahmed May 19 '16 at 05:13
- 
                    2Then save it in **SharedPreference** and Use it later .( when you start it later) – Janki Gadhiya May 19 '16 at 05:15
- 
                    Please explain more. from which activity you want to pass the string/values and where are you planning to use them? – SMR May 19 '16 at 05:17
- 
                    Instead of posting this type of questions.please read some android ebooks. so that you can understand basics – akhil Rao May 19 '16 at 05:17
1 Answers
1
            
            
        There are multiple things you can use in this case:
- Shared Preferences
- static variables (not recommended)
 
    
    
        SMR
        
- 6,628
- 2
- 35
- 56
- 
                    
- 
                    1All that for just to store a simple string. NOPE. A lot of overhead don't you think? Cloud? really? what if internet is not available? – SMR May 19 '16 at 05:58
-