Android Open Source - PiVPN Vpn Adapter

From Project

Back to project page PiVPN.


The source code is released under:

MIT License

If you think the Android project PiVPN listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*w  w  w  .  java 2 s  .c om*/
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Switch;
import android.widget.TextView;

 * Created by mark on 13/07/14.
public class VpnAdapter extends ArrayAdapter<Vpn> {
    public VpnAdapter(Context context) {
        super(context, R.layout.vpn_list);

    public View getView(int position, View convertView, ViewGroup parent) {
        Vpn vpn = getItem(position);

        if (convertView == null) {
            convertView = LayoutInflater.from(getContext()).inflate(R.layout.vpn_list, parent, false);

        TextView nameView = (TextView) convertView.findViewById(;

        Switch switchView = (Switch) convertView.findViewById(;

        return convertView;

Java Source Code List