I have a class called DownloadInfo that consists of a progressBar and two textView , how can I send it via intent and maintain the object at the other side ?
            Asked
            
        
        
            Active
            
        
            Viewed 55 times
        
    1
            
            
        - 
                    Why would you put a View inside a Java Object (aka POJO)? – Sufian Aug 03 '16 at 06:42
- 
                    1Intent is for some specific operations , go through this http://www.tutorialspoint.com/android/android_intents_filters.htm – Sreehari Aug 03 '16 at 06:42
- 
                    only you can send Parcelable obaject or class in your intent – Divyesh Boda Aug 03 '16 at 06:42
- 
                    Can't You make them Static and Access the by it class name from your other activity or by making them Global and access them by object of the class!! – Akash Dubey Aug 03 '16 at 06:47
- 
                    1Possible duplicate of [How to send an object from one Android Activity to another using Intents?](http://stackoverflow.com/questions/2139134/how-to-send-an-object-from-one-android-activity-to-another-using-intents) – Sufian Aug 03 '16 at 06:51
1 Answers
1
            
            
        Implement Serializable to DownloadInfo class. 
Intent intent = new Intent(Youractivity.this, OtherActivity.class);
Bundle args = new Bundle();
args.putSerializable("downloadInfo", DownloadInfo object);
intent.putExtras(args);
On other side:
if (getIntent().hasExtra("downloadInfo"))
    downloadInfo = (DownloadInfo) getIntent().getExtras().getSerializable("downloadInfo");
 
    
    
        faranjit
        
- 1,567
- 1
- 15
- 22
- 
                    Dear @faranjit my downloadInfo object consist of images and progressBar and text ,when I use your code , it says .NotSerializableException: android.widget.ImageView , how can i solve it ? – DavidOli Aug 03 '16 at 09:21
- 
                    
