Click here to Skip to main content
15,881,687 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This is my global class

C#
public class GlobalDataForURL extends Application
{
    String url="";

    public String getName() {
        return url;
    }
    public void setName(String aName) {
        url = aName;
    }
}


i want to access the url in a fragment. how can i acheive this ?
Posted

1 solution

In your fragment,
Java
GlobalDataForURL gData  = new GlobalDataForURL(); 
gDate.setName("www.google.com");
// and later use it like this,
gDate.getName();

Hope you wanted this. ;)


-KR
 
Share this answer
 
Comments
Rahul Ramakrishnan 3-Oct-15 5:24am    
thanks a lot

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900