Example usage for android.widget TextView toString

List of usage examples for android.widget TextView toString

Introduction

In this page you can find the example usage for android.widget TextView toString.

Prototype

public String toString() 

Source Link

Usage

From source file:com.zen.androidhtmleditor.AHEActivity.java

public void loadFileFolder(View v) {

    //RelativeLayout rl = (RelativeLayout)v.getParent();
    //RelativeLayout rl = (RelativeLayout)v;
    View rl = v;//from  w  w  w. j  a  v  a2  s.c  o  m
    TextView typeId = (TextView) rl.findViewById(R.id.typeId);
    TextView fileFolderName = (TextView) rl.findViewById(R.id.fileFolderName);

    if (typeId.getText().toString().equals("folder")) {
        arrayAdapter.clear();
        folderPath = folderPath + fileFolderName.getText().toString() + "/";

        SharedPreferences settings = getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE);
        String currentServers = settings.getString("Accounts", "");
        if (currentServers.equals("")) {
        } else {
            Gson gson = new Gson();
            SearchResponse response = gson.fromJson(currentServers, SearchResponse.class);
            List<Result> results = response.data;
            Result l = results.get(connectedTo);
            if (l.serverName != "" && l.userName != "" && l.port.trim() != "") {
                if (l.sftp.equals("0") || l.sftp.equals("1") || l.sftp.equals("2")) {
                    new MyFetchTask(l.serverName, l.userName, l.passWord, "folder", folderPath, l.sftp, l.port)
                            .execute();
                } else if (l.sftp.equals("3")) {
                    new FetchSSLTask(l.serverName, l.userName, l.passWord, "folder", folderPath, l.sftp, l.port)
                            .execute();
                }
            }
        }
        //new MyFetchTask("zenstudio.com.au", "zenstudi", ".-x$%Wmd5b#C","folder",folderPath).execute();
    } else {

        //tabCount++;

        int tabNum = tabHost.getTabWidget().getChildCount();

        for (int i = 0; i < tabNum; i++) {

            Button b = (Button) tabHost.getTabWidget().getChildAt(i);
            //b.setBackgroundResource(R.drawable.tab_buttons_off);
        }

        SharedPreferences settings = getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE);
        SharedPreferences.Editor editor = settings.edit();
        //editor.putString("fileName", folderPath+fileFolderName.getText().toString()); 
        editor.putInt("connectedTo", connectedTo);
        editor.commit();
        LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,
                LayoutParams.WRAP_CONTENT);
        Button tview = new Button(this);
        tview.setLayoutParams(lp);
        tview.setText(fileFolderName.getText().toString());
        tview.setTextColor(Color.WHITE);
        //tview.setBackgroundResource(R.drawable.tab_buttons_on);

        Intent editFileIntent = new Intent(AHEActivity.this, EditFile.class);
        editFileIntent.putExtra("fileName", folderPath + fileFolderName.getText().toString());

        TabHost.TabSpec spec = tabHost.newTabSpec(folderPath + fileFolderName.getText().toString())
                .setIndicator(tview).setContent(editFileIntent);

        tabHost.addTab(spec);
        tabHost.setCurrentTab(tabNum);
        tabHost.refreshDrawableState();

        //Log.i("TabCount",String.valueOf(tabCount));
        //Intent editFileIntent = new Intent(AHEActivity.this,EditFile.class);
        //startActivity(editFileIntent);
        //Intent editFileIntent = new Intent(AHEActivity.this,TabLoader.class);
        //startActivity(editFileIntent);

    }
    Log.i("clicked", typeId.toString());
}