Example usage for android.app Dialog addContentView

List of usage examples for android.app Dialog addContentView

Introduction

In this page you can find the example usage for android.app Dialog addContentView.

Prototype

public void addContentView(@NonNull View view, @Nullable ViewGroup.LayoutParams params) 

Source Link

Document

Add an additional content view to the screen.

Usage

From source file:com.commonsware.android.arXiv.arXiv.java

private boolean applyMenuChoice(MenuItem item) {
    switch (item.getItemId()) {
    case ABOUT_ID:
        String str = getString(R.string.about_text);
        TextView wv = new TextView(this);
        wv.setPadding(16, 0, 16, 16);/*from   w  w w .  ja v  a 2  s.com*/
        wv.setText(str);

        ScrollView scwv = new ScrollView(this);
        scwv.addView(wv);

        Dialog dialog = new Dialog(this) {
            public boolean onKeyDown(int keyCode, KeyEvent event) {
                if (keyCode != KeyEvent.KEYCODE_DPAD_LEFT)
                    this.dismiss();
                return true;
            }
        };
        dialog.setTitle(R.string.about_arxiv_droid);
        dialog.addContentView(scwv, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
                LinearLayout.LayoutParams.MATCH_PARENT));
        dialog.show();
        return (true);
    case HISTORY_ID:
        Intent myIntent = new Intent(this, DownloadsActivity.class);
        startActivity(myIntent);
        return (true);
    case PREF_ID:
        if (Build.VERSION.SDK_INT >= 11) {
            startActivity(new Intent(this, EditPreferences.class));
        } else {
            startActivity(new Intent(this, EditPreferencesCompat.class));
        }
        return (true);
    case DONATE_ID:
        Intent goToMarket = new Intent(Intent.ACTION_VIEW,
                Uri.parse("market://details?id=com.jd.android.arXiv"));
        try {
            startActivity(goToMarket);
        } catch (Exception ef) {
            Toast.makeText(this, "Market Not Installed", Toast.LENGTH_SHORT).show();
        }
        return (true);
    case SEARCH_ID:
        Intent search = new Intent(this, SearchWindow.class);
        startActivity(search);
        return (true);
    }
    return (false);
}

From source file:com.xxjwd.sjbg.MainActivity.java

 private void doShowDownloadDialog() {
   Dialog builder = new Dialog(this);
    //builder.requestWindowFeature(Window.FEATURE_NO_TITLE);
   builder.setTitle("???");
    builder.getWindow().setBackgroundDrawable(
        new ColorDrawable(android.graphics.Color.TRANSPARENT));
    builder.setOnDismissListener(new DialogInterface.OnDismissListener() {
        @Override// ww  w.  jav a 2s. c o m
        public void onDismiss(DialogInterface dialogInterface) {
            //nothing;
        }
    });

    ImageView imageView = new ImageView(this);
    imageView.setImageResource(R.drawable.erweima);
   imageView.setOnLongClickListener(new OnLongClickListener()
   {

      @Override
      public boolean onLongClick(View v) {
         // TODO Auto-generated method stub
         Intent intent = new Intent();        
           intent.setAction("android.intent.action.VIEW");    
           Uri content_url = Uri.parse("http://61.163.45.215:808/sjbg/download.html");   
           intent.setData(content_url);  
           startActivity(intent);
         return true;
      }
   }
   );
    builder.addContentView(imageView, new RelativeLayout.LayoutParams(
            ViewGroup.LayoutParams.WRAP_CONTENT, 
            ViewGroup.LayoutParams.WRAP_CONTENT));
    builder.show();
      
}

From source file:org.opendatakit.tables.activities.TableDisplayActivity.java

private void showDialogLocNuoc() {
    final ViewFragmentType fage = this.mCurrentFragmentType;
    final Dialog dialog = new Dialog(context);
    LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    dialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    View layout = inflater.inflate(R.layout.dialog_loc, null);
    dialog.addContentView(layout, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
    dialog.setContentView(R.layout.dialog_loc);
    final ListView lv = (ListView) dialog.findViewById(R.id.list_loc);
    TextView title = (TextView) dialog.findViewById(R.id.title);
    List<Model> list = new ArrayList<Model>();
    if (this.getTableId().equals("kdv_dnn_hogiadinh")) {
        list = SqliteLoc.getThonNuoc();//from  w  w w .  ja  v a 2  s . com
    }
    if (this.getTableId().equals("kdv_vs_hogiadinh")) {
        list = SqliteLoc.getThonGiaDinh();
    }
    if (this.getTableId().equals("kdv_vs_congtrinhcongcong")) {
        list = SqliteLoc.getThonCongCong();
    }
    if (loc_position >= 0 && list.size() > 0) {
        Model m = new Model(list.get(loc_position).getName(), true);
        list.set(loc_position, m);
    }
    if (list.size() == 0) {
        title.setText(getString(R.string.dialogloc));
    }
    adapter = new Adapter(this, list);
    lv.setAdapter(adapter);
    lv.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            Model model = (Model) (lv.getItemAtPosition(position));
            String selectedFromList = model.getName();
            Intent intent = getIntent();
            intent.putExtra("loc", selectedFromList);
            intent.putExtra("loc_position", String.valueOf(position));
            intent.putExtra("all", "0");
            intent.putExtra("timkiem", "null");
            switch (fage) {
            case SPREADSHEET:
                intent.putExtra("page", "SPREADSHEET");
                break;
            case LIST:
                intent.putExtra("page", "LIST");
                break;
            case MAP:
                intent.putExtra("page", "MAP");
                break;
            case DETAIL:
                intent.putExtra("page", "DETAIL");
                break;
            default:
                break;
            }
            finish();
            startActivity(intent);
        }
    });
    dialog.show();
}

From source file:org.opendatakit.tables.activities.TableDisplayActivity.java

private void showDialogOder() {
    int i, j = 0, n;
    int k = 0;/*  w w  w  . j ava  2s .c  o  m*/
    final List<String[]> tile = readCsv(context);
    for (n = 0; n < tile.size(); n++) {
        if ("sort".equals(tile.get(n)[0])) {
            j++;
        }
    }
    String[] name = new String[j];
    final ViewFragmentType fage = this.mCurrentFragmentType;
    final Dialog dialog = new Dialog(context);

    LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    dialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    View layout = inflater.inflate(R.layout.dialog_sapxep, null);
    dialog.addContentView(layout, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
    dialog.setContentView(R.layout.dialog_sapxep);
    final ListView lv = (ListView) dialog.findViewById(R.id.list_oder);
    TextView title = (TextView) dialog.findViewById(R.id.title);
    title.setText("Sp xp theo");
    for (i = 0; i < tile.size(); i++) {
        if ("sort".equals(tile.get(i)[0])) {
            name[k] = tile.get(i)[1].toString();
            k++;
        }
    }
    List<Model> list = new ArrayList<Model>();
    for (String elementKey : name) {
        list.add(new Model(elementKey));
    }
    if (oder_position >= 0) {
        Model m = new Model(name[oder_position], true);
        list.set(oder_position, m);
    }
    adapter = new Adapter(this, list);
    lv.setAdapter(adapter);
    lv.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            Model model = (Model) (lv.getItemAtPosition(position));
            String selectedFromList = model.getName();
            for (int n = 0; n < tile.size(); n++) {
                if (selectedFromList.equals(tile.get(n)[1])) {
                    String oder_key = tile.get(n)[2].toString();
                    Intent intent = getIntent();
                    intent.putExtra("oder", oder_key);
                    intent.putExtra("oder_position", String.valueOf(position));
                    intent.putExtra("all", "0");
                    switch (fage) {
                    case SPREADSHEET:
                        intent.putExtra("page", "SPREADSHEET");
                        break;
                    case LIST:
                        intent.putExtra("page", "LIST");
                        break;
                    case MAP:
                        intent.putExtra("page", "MAP");
                        break;
                    case DETAIL:
                        intent.putExtra("page", "DETAIL");
                        break;
                    default:
                        break;
                    }
                    finish();
                    startActivity(intent);
                }
            }

        }

    });
    dialog.show();
}

From source file:org.opendatakit.tables.activities.TableDisplayActivity.java

private void showDialogTimkiem() {
    int i, j = 0, n;
    int k = 0;/*from   w w  w.  ja  va2  s  .c o m*/
    final List<String[]> tile = readCsv(context);
    final ViewFragmentType fage = this.mCurrentFragmentType;
    for (n = 0; n < tile.size(); n++) {
        if ("filter".equals(tile.get(n)[0])) {
            j++;
        }
    }
    String[] name = new String[j];
    final Dialog dialog = new Dialog(context);
    LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    dialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    View layout = inflater.inflate(R.layout.dialog_sapxep, null);
    dialog.addContentView(layout, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
    dialog.setContentView(R.layout.dialog_sapxep);
    final ListView lv = (ListView) dialog.findViewById(R.id.list_oder);
    TextView title = (TextView) dialog.findViewById(R.id.title);
    title.setText("L?c theo trng thi");
    for (i = 0; i < tile.size(); i++) {
        if ("filter".equals(tile.get(i)[0])) {
            name[k] = tile.get(i)[1].toString();
            k++;
        }
    }
    List<Model> list = new ArrayList<Model>();
    for (String elementKey : name) {
        list.add(new Model(elementKey));

    }

    if (position_check >= 0) {

        Model m = new Model(name[position_check], true);
        list.set(position_check, m);
    }
    adapter = new Adapter(this, list);
    lv.setAdapter(adapter);
    lv.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            RadioButton checkbox = (RadioButton) view.getTag(R.id.radioBT);
            checkbox.setChecked(true);
            Model model = (Model) (lv.getItemAtPosition(position));
            String selectedFromList = model.getName();
            for (int n = 0; n < tile.size(); n++) {
                if (selectedFromList.equals(tile.get(n)[1])) {
                    String mj = tile.get(n)[2].toString();
                    Intent intent = getIntent();
                    StringBuilder s = new StringBuilder();
                    s.append(mj);
                    intent.putExtra("timkiem", s.toString());
                    intent.putExtra("vitri", String.valueOf(position));
                    intent.putExtra("all", "0");
                    switch (fage) {
                    case SPREADSHEET:
                        intent.putExtra("page", "SPREADSHEET");
                        break;
                    case LIST:
                        intent.putExtra("page", "LIST");
                        break;
                    case MAP:
                        intent.putExtra("page", "MAP");
                        break;
                    case DETAIL:
                        intent.putExtra("page", "DETAIL");
                        break;
                    default:
                        break;
                    }
                    finish();
                    startActivity(intent);

                }
            }

        }

    });
    dialog.show();

}

From source file:com.sastra.app.timetable.TimetableActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.timetable_main);

    Log.d(TAG, "Entered On Create");

    ActionBar Bar = getActionBar();/*from w  w  w . j  a  va  2s.  com*/
    Bar.setLogo(R.drawable.ic_launcher_1);
    //Bar.setTitle("");
    // String path = Environment.getExternalStorageDirectory().getAbsolutePath() + "/Android/data/SASTRA Timetable/files/test.txt";

    SharedPreferences mPreferences = this.getSharedPreferences("AB", MODE_PRIVATE);

    boolean firstTime = mPreferences.getBoolean("firstTime", true);
    if (firstTime) {

        SharedPreferences.Editor editor = mPreferences.edit();
        editor.putBoolean("firstTime", false);
        editor.commit();
        Dialog d2 = new Dialog(this);
        d2.setTitle("HELP");
        d2.setCanceledOnTouchOutside(true);
        TextView tv = new TextView(this);
        tv.setText(
                "This application can be used to store your timetable.First,click on Manage Subjects Icon(Wrench Icon) inorder to add all your subjects.Click on Add Subjects on top and enter the details of your subject.The fields that appear are optional and not manditory.Once you have added all the subjects,go back to the main screen and click on Add Classes icon(Plus Icon) to add the different classes to your timetable.The fields that appear are again optional and all of them need not be filled.You can long press on any particular subject to edit or delete them.You can delete all the informations using Delete All(Garbage Icon) option.");
        ScrollView sav = new ScrollView(this);
        sav.addView(tv);
        LayoutParams lap = new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
        d2.addContentView(sav, lap);
        d2.show();
    }

    boolean enabled = true;

    Bar.setHomeButtonEnabled(enabled);

    //File database=getApplicationContext().getDatabasePath("massey.db");
    // if (database.exists()) {
    data = new InternalDB(this);
    // }

    // add fragments
    mFragments = new ArrayList<Fragment>();

    mFragments.add(Fragment.instantiate(this, MONDAYFRAGMENT));
    mFragments.add(Fragment.instantiate(this, TUESDAYFRAGMENT));
    mFragments.add(Fragment.instantiate(this, WEDNESDAYFRAGMENT));
    mFragments.add(Fragment.instantiate(this, THURSDAYFRAGMENT));
    mFragments.add(Fragment.instantiate(this, FRIDAYFRAGMENT));
    mFragments.add(Fragment.instantiate(this, SATURDAYFRAGMENT));

    // adapter
    mAdapter = new MainPagerAdapter(getSupportFragmentManager(), mFragments);

    // pager
    mPager = (ViewPager) findViewById(R.id.view_pager);

    mPager.setAdapter(mAdapter);

    // indicator
    mIndicator = (TitlePageIndicator) findViewById(R.id.title_indicator);

    //mIndicator.setBackgroundColor(0x0106000e);
    //mIndicator.setFooterColor(0xffffff);
    mIndicator.setTextColor(0xFF000000);
    mIndicator.setSelectedColor(0xFF000000);
    mIndicator.setViewPager(mPager);

    intent = new Intent(getApplicationContext(), AddSubjects.class);//intent = new Intent(getApplicationContext(), AddSubjects.class);

    builder = new AlertDialog.Builder(this);
    builder.setMessage("Are you sure you want to delete all lessons?").setCancelable(false)
            .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int id) {
                    data.open();
                    data.deleteAllHours();
                    data.close();
                    // update();
                    mAdapter.notifyDataSetChanged();
                    mAdapter.finishUpdate(mPager);
                }
            }).setNegativeButton("No", new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int id) {
                    dialog.cancel();
                }
            });
    alert = builder.create();

    builder2 = new AlertDialog.Builder(this);
    builder2.setMessage("Are you sure you want to delete this lesson?").setCancelable(false)
            .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int id) {
                    data.open();
                    data.deleteHour(OLDSName, OLDHDay, OLDHType, OLDHClass, OLDHStart, OLDHEnd);
                    data.close();
                    //update();
                    mAdapter.notifyDataSetChanged();
                    mAdapter.finishUpdate(mPager);
                }
            }).setNegativeButton("No", new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int id) {
                    dialog.cancel();
                }
            });
    alert2 = builder2.create();

    //added

    addDialog = new Dialog(this);
    addDialog.setCancelable(false);
    action = "insert";
    addDialog.setTitle("Add Class");
    addDialog.setContentView(R.layout.timetable_addhour);

    HType = (EditText) addDialog.findViewById(R.id.typeEdit);
    HClass = (EditText) addDialog.findViewById(R.id.classroomEdit);
    arraydays = new String[] { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" };
    HDay = (Spinner) addDialog.findViewById(R.id.day);
    arrayadapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, arraydays);
    arrayadapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    HDay.setAdapter(arrayadapter);
    HDay.setOnItemSelectedListener(new OnItemSelectedListener() {

        public void onItemSelected(AdapterView<?> arg0, View arg1, int position, long id) {
            selectedDay = arraydays[position];
        }

        public void onNothingSelected(AdapterView<?> arg0) {
            // TODO Auto-generated method stub
        }
    });

    fromDialog = new TimePickerDialog(this, fromTimeSetListener, 12, 0, true);
    toDialog = new TimePickerDialog(this, toTimeSetListener, 12, 0, true);

    //This place is important.

    SName = (Spinner) addDialog.findViewById(R.id.SName);
    SName.setOnItemSelectedListener(new OnItemSelectedListener() {

        public void onItemSelected(AdapterView<?> arg0, View arg1, int position, long id) {
            selectedSubject = (String) arraySubjects[position];
            Log.d("AB", "We are inside the setOnItemSelectedListener for Sname : 264");
            Log.d("AB", selectedSubject);
        }

        public void onNothingSelected(AdapterView<?> arg0) {
            // TODO Auto-generated method stub
        }
    });

    Button buttonFrom = (Button) addDialog.findViewById(R.id.buttonFrom);
    buttonFrom.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            fromDialog.show();
        }
    });

    Button buttonTo = (Button) addDialog.findViewById(R.id.buttonTo);
    buttonTo.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            toDialog.show();
        }
    });

    start = (TextView) addDialog.findViewById(R.id.start);
    end = (TextView) addDialog.findViewById(R.id.end);

    Button cancel = (Button) addDialog.findViewById(R.id.cancel);
    cancel.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            addDialog.cancel();
            fromDialog.updateTime(12, 0);
            toDialog.updateTime(12, 0);
            start.setText("--:--");
            end.setText("--:--");
            HType.setText(null);
            HClass.setText(null);
        }

    });

    Button ok = (Button) addDialog.findViewById(R.id.ok);
    ok.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            int HDay = SDay2IDay(selectedDay);
            if (action.equals("insert")) {
                data.open();
                data.insertIntoHours(selectedSubject, HDay, HType.getText().toString(),
                        HClass.getText().toString(), start.getText().toString(), end.getText().toString());
                data.close();
            } else if (action.equals("edit")) {
                data.open();
                data.updateHours(OLDSName, OLDHType, OLDHClass, OLDHDay, OLDHStart, OLDHEnd, selectedSubject,
                        HDay, HType.getText().toString(), HClass.getText().toString(),
                        start.getText().toString(), end.getText().toString());
                data.close();
            }
            addDialog.cancel();
            fromDialog.updateTime(12, 0);
            toDialog.updateTime(12, 0);
            start.setText("--:--");
            end.setText("--:--");
            HType.setText(null);
            HClass.setText(null);
            mAdapter.notifyDataSetChanged();
            //update();
            mAdapter.finishUpdate(mPager);
        }
    });

}

From source file:com.sastra.app.timetable.TimetableActivity.java

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
    case 0:/*w  w w. j  a  va2  s . c om*/
        startActivityForResult(intent, 0);
        break;
    case 1:
        action = "insert";
        data.open();
        ArrayList<HashMap<String, Object>> arrayS = data.selectSubjects2();
        data.close();
        arraySubjects = new String[arrayS.size()];
        colo = new String[arrayS.size()];

        Iterator<HashMap<String, Object>> it = arrayS.iterator();
        int i = 0;
        while (it.hasNext()) {
            HashMap<String, Object> hm = it.next();
            arraySubjects[i] = hm.get("SName").toString();
            colo[i] = hm.get("SColor").toString();
            Log.d("AB", "This is inside the onOptionsItemSelected Function :485");
            Log.d("AB", arraySubjects[i]);
            Log.d("AB", colo[i]);
            i++;
        }

        newSpinnerAdapter ma = new newSpinnerAdapter(TimetableActivity.this, R.id.text1, arraySubjects);
        SName.setAdapter(ma);

        //mySpinnerAdapter msa = new mySpinnerAdapter(this,arrayS,R.layout.timetable_spinner_layout,from2, to2,colo );
        //msa.setDropDownViewResource(R.layout.timetable_spinner_layout);
        //  SName.setAdapter(msa);

        addDialog.setTitle("Add Class");
        addDialog.show();

        //                  data.open();
        //                  results2 = data.selectSubjects2();
        //                  data.close();
        //                  colorVet2 = new String[results2.size()];
        //                  for(int i=0;i<results2.size();i++) {
        //                     HashMap<String, Object> color = new HashMap<String, Object>();
        //                     
        //                     color = results2.get(i);
        //                     colorVet2[i] = (String) color.get("SColor");
        //                  }
        //                   

        // Sarrayadapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item, arraySubjects);
        //Sarrayadapter = new ArrayAdapter<String>(this,R.layout.timetable_spinner_layout, arraySubjects);
        //Sarrayadapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);

        break;
    case 2:
        alert.show();
        break;
    case 3:

        Dialog d = new Dialog(this);
        d.setCanceledOnTouchOutside(true);
        d.setTitle("ABOUT");
        TextView tv2 = new TextView(this);
        tv2.setText(
                "This application was developed by R.R.Arun Balaji,a student of SASTRA University.Special Thanks to J.Sivaguru from SASTRA.\n\nLICENSE INFORMATION : \nSASTRA TimeTable\nThis program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the GNU General Public License for more details.This program makes use of the following libary ViewPageIndicator licensed under Apache License 2.0 and modifies the StudentTimeTable application made by Mazzarelli Alessio and Hopstank,distributed under GNU GPL v3.");
        ScrollView sv = new ScrollView(this);
        sv.addView(tv2);
        LayoutParams lp = new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
        d.addContentView(sv, lp);
        d.setTitle("About");
        d.show();
        break;
    case 4:
        Dialog d2 = new Dialog(this);
        d2.setTitle("HELP");
        d2.setCanceledOnTouchOutside(true);
        TextView tv = new TextView(this);
        tv.setText(
                "This application can be used to store your timetable.\nFirst,click on Manage Subjects Icon(Wrench Icon) inorder to add all your subjects.Click on Add Subjects on top and enter the details of your subject.The fields that appear are optional and not manditory.\n\nOnce you have added all the subjects,go back to the main screen and click on Add Classes icon(Plus Icon) to add the different classes to your timetable.The fields that appear are again optional and all of them need not be filled.You can long press on any particular subject to edit or delete them.You can delete all the informations using Delete All(Garbage Icon) option.");
        ScrollView sav = new ScrollView(this);
        sav.addView(tv);
        LayoutParams lap = new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
        d2.addContentView(sav, lap);
        d2.show();
        break;

    }
    return false;
}