The constructor WifiInfo() is not visible

by Flappie » Mon, 03 Nov 2008 13:40:08 GMT


Sponsored Links
 Yes i know.....i'm a newbie.
But i'm currently learning the syntax of android using Eclipse.
I'm trying to get the network SSID and just through it to the
log.....for learning purpose i would say.
this is my part code:

WifiInfo checkx = new WifiInfo();
android.util.Log.v("sometag","SSID= " + checkx.getSSID());

I get a error on the "new WifiInfo()" part.
Saying: "The constructor WifiInfo() is not visible"
Why can't it find/see the contructor of this Class?

It's comming from:
namespace: android.net.wifi.WifiInfo;

I know...i'm a newbie but i've got to start somewhere.......

--~--~---------~--~----~------------~-------~--~----~



The constructor WifiInfo() is not visible

by Jason Parekh » Mon, 03 Nov 2008 14:06:01 GMT


 hey Flappie,

The WifiInfo constructor isn't public as it's not meant to be instantiated
by clients.  Instead, you retrieve it from WifiManager's getConnectionInfo.
You can get a reference to WifiManager by using
context.getSystemService(Context.WIFI_SERVICE) (and casting it).

For more info, check out:
 http://code.google.com/android/reference/android/net/wifi/WifiManager.html 

jason






--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. Data transfer from WindowManagerService.java to WindowManager.java

Hi everyone,
I have some required data in WindowManagerService.java file (let me
say , mWindows).  I want to query that data from WindowManager.java
file.
For example :
       I want to have the list of Window Objects in WindowManager.java
file , I can get the list from  WindowManagerService.java file
(mWindows). So I want to add one function in WindowManager.java ,
say           public Window[ ] getWindowObjects ();

Could anyone tell me how can I do this.. I will be waiting for
someone's help.



Thank you.

-- 

2. SetTypeface with holder

Hi!

 public View getView(int position, View convertView, ViewGroup parent) {
        View vi=convertView;
        ViewHolder holder;

        if(convertView==null){
            System.out.println("inside
null........................................");
            vi = inflater.inflate(R.layout.item, null);
            holder=new ViewHolder();
            holder.text=(TextView)vi.findViewById(R.id.text);
            holder.text1=(TextView)vi.findViewById(R.id.text1);
           Typeface tf = holder.text1.getTypeface();
            holder.text1.setTypeface(tf);
            holder.image=(ImageView)vi.findViewById(R.id.image);
            vi.setTag(holder);


        }
        else
            holder=(ViewHolder)vi.getTag();

        holder.text.setText(Listdisplay.name[position]);
        holder.text1.setText(Listdisplay.count[position]);

        holder.image.setTag(data[position]);
        System.out.println("inside not
null...........................................");
        imageLoader.DisplayImage(data[position], activity, holder.image);
        return vi;
    }
}

-- 

3. Android Hadirkan ESPN Live TV Streaming

4. HTC Siapkan Versi Internasional Dari myTouch 4G

5. setTypeface

6. Problem in Creating Menu

7. Google I/O 2011 sudah dalam hitungan jam