Example usage for android.content DialogInterface cancel

List of usage examples for android.content DialogInterface cancel

Introduction

In this page you can find the example usage for android.content DialogInterface cancel.

Prototype

void cancel();

Source Link

Document

Cancels the dialog, invoking the OnCancelListener .

Usage

From source file:com.example.amapapplicationtest.MainActivity.java

/** Called when the activity is first created. */
@Override/*from www  .ja va 2 s .co m*/
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    initMap();

    LocationManager lm = (LocationManager) getSystemService(LOCATION_SERVICE);
    String provider = lm.getBestProvider(new Criteria(), true);

    LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
    Criteria criteria = new Criteria();

    Location location = locationManager.getLastKnownLocation(locationManager.getBestProvider(criteria, false));
    if (location != null) {
        googlemap.animateCamera(CameraUpdateFactory
                .newLatLngZoom(new LatLng(location.getLatitude(), location.getLongitude()), 13));

        CameraPosition cameraPosition = new CameraPosition.Builder()
                .target(new LatLng(location.getLatitude(), location.getLongitude())) // Sets the center of the map to location user
                .zoom(17) // Sets the zoom
                .bearing(90) // Sets the orientation of the camera to east
                .tilt(40) // Sets the tilt of the camera to 30 degrees
                .build(); // Creates a CameraPosition from the builder
        googlemap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));

    }

    if (provider == null) {
        onProviderDisabled(provider);
    }
    data = new MarkerDataSource(context);
    try {
        data.open();

    } catch (Exception e) {
        Log.i("hello", "hello");
    }

    List<MyMarkerObj> m = data.getMyMarkers();
    for (int i = 0; i < m.size(); i++) {
        String[] slatlng = m.get(i).getPosition().split(" ");
        LatLng lat = new LatLng(Double.valueOf(slatlng[0]), Double.valueOf(slatlng[1]));
        googlemap.addMarker(
                new MarkerOptions().title(m.get(i).getTitle()).snippet(m.get(i).getSnippet()).position(lat));

        googlemap.setOnInfoWindowClickListener(new GoogleMap.OnInfoWindowClickListener() {

            public void onInfoWindowClick(Marker marker) {
                Toast.makeText(getBaseContext(), "Info Window clicked@" + marker.getId(), Toast.LENGTH_SHORT)
                        .show();
            }
        });

        //  marker.view();
        //    data.getMarker(new MyMarkerObj(marker.getTitle(), marker.getSnippet(), marker.getPosition().latitude + " " + marker.getPosition().longitude));
    }

    googlemap.setOnMapLongClickListener(new GoogleMap.OnMapLongClickListener() {

        public void onMapLongClick(final LatLng latlng) {
            LayoutInflater li = LayoutInflater.from(context);
            final View v = li.inflate(R.layout.alertlayout, null);
            AlertDialog.Builder builder = new AlertDialog.Builder(context);
            builder.setView(v);
            builder.setCancelable(false);

            builder.setPositiveButton("Create", new DialogInterface.OnClickListener() {

                public void onClick(DialogInterface dialog, int which) {
                    EditText title = (EditText) v.findViewById(R.id.ettitle);
                    EditText snippet = (EditText) v.findViewById(R.id.etsnippet);
                    googlemap.addMarker(new MarkerOptions().title(title.getText().toString())
                            .snippet(snippet.getText().toString())
                            .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_BLUE))
                            .position(latlng));
                    String sll = latlng.latitude + " " + latlng.longitude;
                    data.addMarker(
                            new MyMarkerObj(title.getText().toString(), snippet.getText().toString(), sll));
                }
            });

            builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {

                public void onClick(DialogInterface dialog, int which) {
                    dialog.cancel();
                }
            });

            AlertDialog alert = builder.create();
            alert.show();

        }
    });
}

From source file:com.cm.android.beercellar.ui.ImageGridFragment.java

private void logout() {
    AlertDialog.Builder builder = new AlertDialog.Builder(ImageGridFragment.this.getActivity());

    builder.setMessage("Logout?").setPositiveButton("Logout now", new DialogInterface.OnClickListener() {
        @Override//from   w  w w.ja  v  a  2 s.c  o m
        public void onClick(DialogInterface dialog, int id) {
            AuthProvider.getAuthProvider().logout();
            getActivity().finish();
        }
    }).setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int id) {
            dialog.cancel();
        }
    }).show();
}

From source file:ca.ualberta.app.activity.FragmentProfile.java

/**
 * will be called when user want to re-set the username
 *//*from   w ww .ja  v a2  s .co  m*/
private void showDialog() {
    AlertDialog.Builder alert = new AlertDialog.Builder(getActivity());
    alert.setTitle("Change Author Name");
    alert.setMessage("Enter Your Name Here");

    final EditText input = new EditText(getActivity());
    alert.setView(input);

    alert.setPositiveButton("OK", new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int whichButton) {
            newUsername = input.getEditableText().toString();
            if (newUsername != null) {
                if (!authorMapController.hasAuthor(mcontext, newUsername)) {
                    User.author.setUsername(newUsername);
                    authorMapController.updateAuthor(mcontext, User.author);

                } else {
                    Toast.makeText(getActivity(), "The username is aready exist, please choose another one.",
                            Toast.LENGTH_SHORT).show();
                    showDialog();
                }
                setAuthorName.setText(User.author.getUsername());
            } else
                Toast.makeText(mcontext, "Please fill in name", Toast.LENGTH_SHORT).show();
        }

    });
    alert.setNegativeButton("CANCEL", new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int whichButton) {
            dialog.cancel();
        }
    });
    AlertDialog alertDialog = alert.create();
    alertDialog.show();
}

From source file:co.edu.uniajc.vtf.content.MapSitesFragment.java

public Dialog createDialog() {
    LayoutInflater loInflater = this.getActivity().getLayoutInflater();

    AlertDialog.Builder loAlert = new AlertDialog.Builder(getActivity());
    loAlert.setView(loInflater.inflate(R.layout.dialog_search, null));
    loAlert.setPositiveButton(R.string.general_menus_search, new DialogInterface.OnClickListener() {
        @Override//from  w  w  w.j  av a2  s. c  o m
        public void onClick(DialogInterface dialog, int id) {
            OptionsManager loOptions = new OptionsManager(MapSitesFragment.this.getActivity());
            OptionsEntity loOptionsData = loOptions.getOptions();
            EditText loSearchControl = (EditText) ((AlertDialog) dialog).findViewById(R.id.txtSearch);
            loOptionsData.setSearch(loSearchControl.getText().toString());
            loOptions.createOrUpdateOptions(loOptionsData);
            MapSitesFragment.this.cboForceUpdate = true;
            MapSitesFragment.this.loadList(LoadActions.LOAD_DATA);
            dialog.dismiss();
        }
    });

    loAlert.setNegativeButton(R.string.general_menus_cancel, new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int id) {
            dialog.cancel();
            dialog.dismiss();
        }
    });

    loAlert.setNeutralButton(R.string.general_menus_clear, new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int id) {
            OptionsManager loOptions = new OptionsManager(MapSitesFragment.this.getActivity());
            OptionsEntity loOptionsData = loOptions.getOptions();
            loOptionsData.setSearch("");
            loOptions.createOrUpdateOptions(loOptionsData);
            EditText loSearchControl = (EditText) ((AlertDialog) dialog).findViewById(R.id.txtSearch);
            loSearchControl.setText("");
            MapSitesFragment.this.cboForceUpdate = true;
            MapSitesFragment.this.loadList(LoadActions.LOAD_DATA);
            dialog.dismiss();
        }
    });
    loAlert.setCancelable(false);
    return loAlert.create();
}

From source file:com.todoroo.astrid.taskrabbit.TaskRabbitActivity.java

@SuppressWarnings("nls")
private void buildAlertMessageNoGps() {
    final AlertDialog.Builder builder = new AlertDialog.Builder(this);
    builder.setMessage(getString(R.string.tr_alert_gps_title)).setCancelable(false)
            .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
                public void onClick(final DialogInterface dialog, final int id) {
                    startActivityForResult(new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS),
                            REQUEST_CODE_ENABLE_GPS);
                    showingNoGPSAlertMessage = false;
                }//from ww  w. ja v a  2s .c o m
            }).setNegativeButton("No", new DialogInterface.OnClickListener() {
                public void onClick(final DialogInterface dialog, final int id) {
                    dialog.cancel();
                    showingNoGPSAlertMessage = false;
                    showIntroDialog();
                }
            });
    final AlertDialog alert = builder.create();
    alert.show();
}

From source file:com.cmput301w15t15.travelclaimsapp.activitys.EditClaimActivity.java

/**
 * Create a alert dialog for entering Destination values 
 * /*  w  w w .  ja  va2s  .co m*/
 */
private void showDestinationAlert(final String dlocation, final String dreason) {
    final EditText enterLocation = new EditText(this);
    final EditText enterReason = new EditText(this);

    if (!dlocation.equals("")) {
        enterLocation.setText(dlocation);
    }
    if (!dreason.equals("")) {
        enterReason.setText(dreason);
    }
    enterLocation.setHint("Enter location");
    enterReason.setHint("Enter reason");

    LinearLayout linearLayout = new LinearLayout(this);
    linearLayout.setOrientation(LinearLayout.VERTICAL);
    linearLayout.addView(enterLocation);
    linearLayout.addView(enterReason);

    AlertDialog.Builder alert = new AlertDialog.Builder(this);

    alert.setView(linearLayout);

    alert.setPositiveButton("Add", new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int whichButton) {
            Destination dest = new Destination(enterLocation.getText().toString(),
                    enterReason.getText().toString());
            ClaimListController.addDestination(dest, theClaim);

            //open Map activity and make user pick a geolocation
            Intent intent = GeoLocationController.pickLocationIntent(EditClaimActivity.this);
            startActivityForResult(intent, GET_GEOLOCATION_CODE);

            destAdaptor.notifyDataSetChanged();

        }
    });
    alert.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int whichButton) {
            dialog.cancel();
        }
    });

    alert.show();
}

From source file:com.taw.gotothere.GoToThereActivity.java

/**
 * Display a warning dialog asking the user if they are sure they want to
 * cancel navigation.//from w  ww.j a v  a 2  s.c  om
 */
private void displayCancelNavigationDialog() {
    new AlertDialog.Builder(this).setTitle(getResources().getString(R.string.navigation_dialog_title))
            .setMessage(getResources().getString(R.string.navigation_dialog_text))
            .setPositiveButton(getResources().getString(R.string.yes_button_label),
                    new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int id) {
                            stopNavigation();
                        }
                    })
            .setNegativeButton(getResources().getString(R.string.no_button_label),
                    new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int id) {
                            dialog.cancel();
                        }
                    })
            .show();
}

From source file:com.androidaq.AndroiDAQMain.java

@Override
public Dialog onCreateDialog(int id) {
    switch (id) {
    case CLEAR_SCREEN:
        return new AlertDialog.Builder(AndroiDAQMain.this).setIcon(android.R.drawable.ic_dialog_alert)
                .setMessage("Do you really want to clear the screen and its data?")
                .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
                    @Override/*from  w w w.j  a va 2  s.c  o m*/
                    public void onClick(DialogInterface dialog, int whichButton) {
                        clearScreen();
                    }
                }).setNegativeButton("No", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int whichButton) {
                        dialog.cancel();
                    }
                }).create();
    case DELETE:
        return new AlertDialog.Builder(AndroiDAQMain.this).setIcon(android.R.drawable.ic_dialog_alert)
                .setMessage("Do you really want to delete the log file and its data?")
                .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int whichButton) {
                        fromMenu = true;
                        String message8 = "08\r";
                        sendMessage(message8);
                    }
                }).setNegativeButton("No", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int whichButton) {
                        dialog.cancel();
                    }
                }).create();
    case TOO_MANY_PULSED:
        return new AlertDialog.Builder(AndroiDAQMain.this).setIcon(android.R.drawable.ic_dialog_alert)
                .setMessage("You can only set 8 channels for frequency output! Please check your settings.")
                .setNegativeButton("OK", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int whichButton) {
                        dialog.cancel();
                    }
                }).create();
    }
    return null;
}

From source file:com.g_node.gca.abstracts.AbstractContentTabFragment.java

private void getAndUpdateAbstractFiguresBtn() {
    String getFiguresQuery = "SELECT * FROM ABSTRACT_FIGURES WHERE ABSTRACT_UUID = '" + value + "';";
    Cursor absFiguresCursor = DatabaseHelper.database.rawQuery(getFiguresQuery, null);

    if (absFiguresCursor.getCount() > 0) {
        btnOpenAbstractFig.setText("Show Figures" + "  (" + absFiguresCursor.getCount() + ")");

        btnOpenAbstractFig.setOnClickListener(new OnClickListener() {

            @Override/* w ww .java2  s.com*/
            public void onClick(View arg0) {
                //if Internet is connected
                if (isNetworkAvailable()) {

                    //check if interent is WIFI
                    ConnectivityManager connManager = (ConnectivityManager) getActivity()
                            .getSystemService(Context.CONNECTIVITY_SERVICE);
                    NetworkInfo mWifi = connManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
                    NetworkInfo mMobile = connManager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);

                    if (mWifi.isConnected()) {
                        //Toast.makeText(getActivity(), "Connected via WLAN", Toast.LENGTH_SHORT).show();
                        Intent figuresIntent = new Intent(getActivity(), AbstractFiguresActivity.class);
                        figuresIntent.putExtra("abs_uuid", value);
                        startActivity(figuresIntent);

                    } else if (mMobile.isConnected()) {
                        //if connected with mobile data - 2G, 3G, 4G etc
                        //Toast.makeText(getActivity(), "Connected via Mobile Internet", Toast.LENGTH_SHORT).show();

                        AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
                        builder.setTitle("Additional Traffic Warning").setMessage(
                                "Downloading of Figures over Mobile Internet may create additional Traffic. Do you want to Continue ?")
                                .setPositiveButton("Continue", new DialogInterface.OnClickListener() {
                                    public void onClick(DialogInterface dialog, int id) {
                                        // if user Agrees to continue
                                        Intent figuresIntent = new Intent(getActivity(),
                                                AbstractFiguresActivity.class);
                                        figuresIntent.putExtra("abs_uuid", value);
                                        startActivity(figuresIntent);
                                    }
                                }).setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
                                    public void onClick(DialogInterface dialog, int id) {
                                        // Handle Cancel
                                        dialog.cancel();
                                    }
                                }).setIcon(android.R.drawable.ic_dialog_alert).show();

                    } else {
                        ;
                    } //end if/else of wlan/mobile

                } else {
                    Toast.makeText(getActivity(),
                            "Not Connected to Internet - Please connect to Internet first", Toast.LENGTH_SHORT)
                            .show();
                } //end if/else of isNetworkAvailable

            }
        });

    } else {
        btnOpenAbstractFig.setText("No Figures Found");
        btnOpenAbstractFig.setEnabled(false);
        //btnOpenAbstractFig.setVisibility(View.GONE);
    }
}

From source file:com.HumanDecisionSupportSystemsLaboratory.DD_P2P.LoadPK.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    View view = inflater.inflate(R.layout.dialog_load_pk, container);

    load = (Button) view.findViewById(R.id.dialog_load_pk_load);
    load.setText(Util.__("Import"));

    address = (EditText) view.findViewById(R.id.dialog_load_pk_editText);

    getDialog().setTitle("Import from Text");

    load.setOnClickListener(new View.OnClickListener() {

        @Override// w  ww .j  av a2s. c  o m
        public void onClick(View v) {
            strAddress = address.getText().toString();

            //Interpret
            String body = DD.extractMessage(strAddress); //extractMessage(strAddress);

            if (body == null) {
                if (_DEBUG)
                    Log.d(TAG, "LoadPK: Extraction of body failed");
                Toast.makeText(getActivity(),
                        "Separators not found: \"" + DD.SAFE_TEXT_MY_HEADER_SEP
                                + DD.SAFE_TEXT_ANDROID_SUBJECT_SEP + DD.SAFE_TEXT_MY_BODY_SEP + "\"",
                        Toast.LENGTH_SHORT).show();
                FragmentTransaction ft = getActivity().getSupportFragmentManager().beginTransaction();
                ft.detach(LoadPK.this);
                ft.commit();
                return;
            }

            net.ddp2p.common.util.StegoStructure imported_object = DD.interpreteASN1B64Object(body); //interprete(body);

            if (imported_object == null) {
                if (_DEBUG)
                    Log.d(TAG, "LoadPK: Decoding failed");
                Toast.makeText(getActivity(), "Failed to decode", Toast.LENGTH_SHORT).show();
                FragmentTransaction ft = getActivity().getSupportFragmentManager().beginTransaction();
                ft.detach(LoadPK.this);
                ft.commit();
                return;
            }

            String interpretation = imported_object.getNiceDescription();
            //ask confirm
            address.setText(interpretation);

            AlertDialog.Builder confirm = new AlertDialog.Builder(getActivity());
            confirm.setTitle("Do you wish to load?");
            confirm.setMessage(interpretation).setCancelable(false)
                    .setPositiveButton("Yes", new MyDialog_OnClickListener(imported_object) {
                        public void _onClick(DialogInterface dialog, int id) {
                            Log.d("PK", "LoadPK: Trying to save");
                            StegoStructure imported_object = (StegoStructure) ctx;
                            try {
                                imported_object.save();
                                Toast.makeText(getActivity(), "Saving successful!", Toast.LENGTH_SHORT).show();
                            } catch (P2PDDSQLException e) {
                                e.printStackTrace();
                                Log.d("PK", "LoadPK: Failed to save: " + e.getLocalizedMessage());
                            }

                            FragmentTransaction ft = getActivity().getSupportFragmentManager()
                                    .beginTransaction();
                            ft.detach(LoadPK.this);
                            ft.commit();
                            dialog.cancel();
                        }
                    }).setNegativeButton("No", new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int id) {
                            FragmentTransaction ft = getActivity().getSupportFragmentManager()
                                    .beginTransaction();
                            ft.detach(LoadPK.this);
                            ft.commit();
                            dialog.cancel();
                        }
                    });

            AlertDialog confirmDialog = confirm.create();
            confirmDialog.show();
        }
        /*
                 private String extractMessage(String strAddress) {
                    //boolean DEBUG = true;
                    String addressASN1B64;
                    try {
                       if (strAddress == null) {
          if (DEBUG) Log.d(TAG, "LoadPK: Address = null");
            FragmentTransaction ft = getActivity().getSupportFragmentManager().beginTransaction();
            ft.detach(LoadPK.this);
            ft.commit();
          return null;
                       }
                       //strAddress = strAddress.trim();
                       if (DEBUG) Log.d(TAG, "LoadPK: Address="+strAddress);
                               
                       String[] __chunks = strAddress.split(Pattern.quote(DD.SAFE_TEXT_MY_BODY_SEP));
                       if (__chunks.length == 0 || __chunks[__chunks.length - 1] == null) {
          if (DEBUG) Log.d(TAG, "LoadPK: My top Body chunk = null");
            FragmentTransaction ft = getActivity().getSupportFragmentManager().beginTransaction();
            ft.detach(LoadPK.this);
            ft.commit();
          return null;
                       }
                       if (__chunks.length > 1) {
          addressASN1B64 = __chunks[__chunks.length - 1];
          addressASN1B64 = addressASN1B64.trim();
          if (DEBUG) Log.d(TAG, "LoadPK: got Body=" + addressASN1B64);
          addressASN1B64 = Util.B64Join(addressASN1B64);
          if (DEBUG) Log.d(TAG, "LoadPK: got Body=" + addressASN1B64);
          return addressASN1B64;
                       }
                               
                       String[] chunks = strAddress.split(Pattern.quote(DD.SAFE_TEXT_MY_HEADER_SEP));
                       if (chunks.length == 0 || chunks[chunks.length - 1] == null) {
          if (DEBUG) Log.d(TAG, "LoadPK: My Body chunk = null");
            FragmentTransaction ft = getActivity().getSupportFragmentManager().beginTransaction();
            ft.detach(LoadPK.this);
            ft.commit();
          return null;
                       }
                               
                       String body = chunks[chunks.length - 1];
                       if (DEBUG) Log.d(TAG, "LoadPK: Body="+body);
                               
                       String[] _chunks = strAddress.split(Pattern.quote(DD.SAFE_TEXT_ANDROID_SUBJECT_SEP));
                       if (_chunks.length == 0 || _chunks[_chunks.length - 1] == null) {
          if (DEBUG) Log.d(TAG, "LoadPK: Android Body chunk = null");
            FragmentTransaction ft = getActivity().getSupportFragmentManager().beginTransaction();
            ft.detach(LoadPK.this);
            ft.commit();
          return null;
                       }
                   
                       addressASN1B64 = _chunks[_chunks.length - 1];
                       addressASN1B64 = addressASN1B64.trim();
                       if (DEBUG) Log.d(TAG, "LoadPK: Body=" + addressASN1B64);
                       addressASN1B64 = Util.B64Join(addressASN1B64);
                       if (DEBUG) Log.d(TAG, "LoadPK: Body=" + addressASN1B64);
                       return addressASN1B64;
                    } catch (Exception e) {
                       e.printStackTrace();
                    }
                    return null;
                 }
        //         public  StegoStructure getStegoStructure(BigInteger ASN1TAG) {
        //            Log.d("Import", "BN = "+ ASN1TAG);
        //            for (StegoStructure ss : DD.getAvailableStegoStructureInstances()) {
        //               Log.d("Import", "Available = "+ ss+" ID="+""+ss.getSignShort());
        //               if (ASN1TAG.equals (new BigInteger(""+ss.getSignShort()))) {
        //                  try {
        //                     Log.d("Import", "Match");
        //                     return (StegoStructure) ss.getClass().newInstance();
        //                  } catch (Exception e) {
        //                     e.printStackTrace();
        //                  }
        //               }
        //            }
        //            return null;
        //         }
        */

        private net.ddp2p.common.util.StegoStructure interprete(String addressASN1B64) {
            byte[] msg = null;
            StegoStructure ss = null;
            try {
                Log.d("Import", addressASN1B64);
                msg = Util.byteSignatureFromString(addressASN1B64);

                Decoder dec = new Decoder(msg);

                //               StegoStructure s2s = getStegoStructure(dec.getTagValueBN());

                ss = DD.getStegoStructure(dec);
                if (ss == null) {
                    Log.d("Import", "LoadPK. Use default stego");
                    ss = new DD_Address();
                }
                //DD_Address da =
                ss.setBytes(msg);
                return ss;
            } catch (Exception e) {
                e.printStackTrace();
                DD_SK dsk = new DD_SK();
                Log.d("Import", "LoadPK. Try SK");

                try {
                    dsk.setBytes(msg);
                    Log.d("Import", "LoadPK. got=" + dsk);
                    return dsk;
                } catch (Exception e2) {
                    e2.printStackTrace();
                    Log.d("Import", "LoadPK. err sk=" + e2.getLocalizedMessage());
                }
            }
            return null;
        }
    });

    return view;
}