Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <RelativeLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:paddingTop="20px"
- android:paddingBottom="70px" >
- <ImageButton
- android:id="@+id/imageButton_myscript"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:paddingTop="0dp"
- android:scaleType="centerInside"
- android:src="@drawable/handwrite_wide"/>
- <TextView
- android:id="@+id/pref_user"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:paddingTop="20dp"
- android:layout_centerHorizontal="true"/>
- </RelativeLayout>
- private void addListenerOnButtonMyScript() {
- // TODO Auto-generated method stub
- imageButton = (ImageButton) findViewById(R.id.imageButton_myscript);
- imageButton.setOnClickListener(new OnClickListener() {
- public void onClick(View arg0) {
- Log.i("SingleViewActivity:onCreate:addListenerOnButtonMyScript" + ":onKey" , "Initiate myScript:");
- final Intent intent = new Intent();
- intent.setClassName("com.visionobjects.textwidget.sample", "com.visionobjects.textwidget.sample.SampleActivity");
- startActivity(intent);
- }
- });
- }
- //EDITED VERSION TO CALL ON SHARED PREFERENCES FUNCTION TO DISPLAY EDITED TEXT FROM MY_SCRIPT-20/10/2014
- private void loadSavedPreferences(){
- SharedPreferences pref = getSharedPreferences(getString(R.string.pref_text),MODE_PRIVATE);
- SharedPreferences.Editor editor= pref.edit();
- editor.commit();
- }
- private void savePreferences(String key, String value) {
- SharedPreferences pref = getSharedPreferences(getString(R.string.pref_text),MODE_PRIVATE);
- SharedPreferences.Editor editor = pref.edit();
- editor.putString(getString(R.string.pref_text),"");
- editor.commit();
- startActivity(getIntent());
- }
- @Override
- public void onClick(View v) {
- // TODO Auto-generated method stub
- final Intent intent = new Intent();
- intent.setClassName("com.visionobjects.textwidget.sample", "com.visionobjects.textwidget.sample.SampleActivity");
- startActivity(intent);
- }
- //END OF EDITED VERSION TO CALL ON SHARED PREFERENCES FUNCTION TO DISPLAY EDITED TEXT FROM MY_SCRIPT-20/10/2014
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement