Index: TibisayMovil/src/ve/gob/cenditel/tibisaymovil/PreferencesActivity.java
===================================================================
--- TibisayMovil/src/ve/gob/cenditel/tibisaymovil/PreferencesActivity.java	(revision 2ff9cecf77319e9047db41bbba9d55aa15e8ecc6)
+++ TibisayMovil/src/ve/gob/cenditel/tibisaymovil/PreferencesActivity.java	(revision 288126d7faf1d05b5222029383542ccbbb4d4a26)
@@ -1,176 +1,12 @@
 package ve.gob.cenditel.tibisaymovil;
-import java.io.File;
+import android.os.Bundle;
+import android.preference.PreferenceActivity;
 
-import android.content.Intent;
-import android.content.SharedPreferences;
-import android.database.Cursor;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
-import android.net.Uri;
-import android.os.Bundle;
-import android.preference.ListPreference;
-import android.preference.Preference;
-import android.preference.Preference.OnPreferenceChangeListener;
-import android.preference.Preference.OnPreferenceClickListener;
-import android.preference.PreferenceActivity;
-import android.provider.MediaStore;
-import android.view.Window;
-import android.widget.Toast;
-
-public class PreferencesActivity extends PreferenceActivity implements OnPreferenceClickListener,OnPreferenceChangeListener{
-	
-	static final int PICK_IMAGE = 33;
-	public static final String imageKey = "image";
-	public static final String positionKey = "position";
-	private static final int MAXWIDTH = 400;
-	private static final int MAXHEIGHT = 400;
-	private static final long SIZELIMIT = 1024 * 1024;
-	
-	private SharedPreferences options;
-	private Preference imagePreference;
-	
+public class PreferencesActivity extends PreferenceActivity {
     @Override
     public void onCreate(Bundle savedInstanceState) {
-		//Estilando la barra de titulo
-		final boolean customTitleSupported = requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
-
         super.onCreate(savedInstanceState);
-
+ 
         addPreferencesFromResource(R.xml.preferences);
-        
-        this.options = this.getPreferenceManager().getSharedPreferences();
-        
-        
-
-        
-        this.imagePreference = (Preference) findPreference(PreferencesActivity.imageKey);
-        this.imagePreference.setOnPreferenceClickListener(this);
-        this.imagePreference.setOnPreferenceChangeListener(this);
-        
-        this.loadSummary();
-        
-
-        //Estilando Barra de titulo
-		if(customTitleSupported)
-			getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.title_bar);
-        
     }
-    
-	private void loadSummary() {
-	    String path = options.getString(PreferencesActivity.imageKey, "");
-        if (!path.equals("")){
-        	this.imagePreference.setSummary(path);
-        }
-        
-	}
-
-    
-    
-    @Override
-	public boolean onPreferenceChange(Preference preference, Object newValue) {
-    	  String summary="";
-       	  
-    	  
-    	  if (summary!=null && !summary.equals("")){
-    		  preference.setSummary((CharSequence) summary);
-		  	  
-		  }
-    	  return true;
-	}
-
-
-	
-	@Override
-	public boolean onPreferenceClick(Preference preference) {
-		
-		if (preference.getKey().equals(PreferencesActivity.imageKey)){
-				Intent i = new Intent(
-				Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
-				startActivityForResult(i, PreferencesActivity.PICK_IMAGE);
-				return true;
-		}
-		return false;
-	}
-    
-	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
-	     super.onActivityResult(requestCode, resultCode, data);
-	     
-	     
-	     if (requestCode == PreferencesActivity.PICK_IMAGE && resultCode == RESULT_OK){
-	    	 
-	    	 Uri selectedImage = data.getData();
-	         String[] filePathColumn = { MediaStore.Images.Media.DATA };
-	 
-	         Cursor cursor = getContentResolver().query(selectedImage,filePathColumn, null, null, null);
-	         cursor.moveToFirst();
-	 
-	         int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
-	         String imageSelectedPath = cursor.getString(columnIndex);
-	         cursor.close();
-	         
-	         //Filter images if wrong format.
-	         boolean validImage = this.validateImage(imageSelectedPath);
-	         
-	    	 if (validImage==true){
-	    		 //Save and edit summary text in user interface.
-	    		SharedPreferences.Editor editor = this.options.edit();
-	         	editor.putString(PreferencesActivity.imageKey, imageSelectedPath);
-	         	editor.commit();
-	         	this.imagePreference.setSummary(imageSelectedPath);
-	    	 }
-	         
-	     
-	  
-	     }
-
-	     
-	     
-	     
-	}
-
-	//Check image dimensions and format.
-	private boolean validateImage(String imageSelectedPath) {
-		File f = new File(imageSelectedPath);
-		long size = f.length();
-
-		if (size <= (PreferencesActivity.SIZELIMIT)) {
-			
-			Bitmap chosenImage = BitmapFactory.decodeFile(imageSelectedPath);
-			
-			if (chosenImage !=null)
-				return this.checkDimensions(chosenImage);
-			else{
-				Toast.makeText(this, this.getString(R.string.errorformat),Toast.LENGTH_SHORT).show();
-				return false;
-			}
-
-		} else {
-			Toast.makeText(this, this.getString(R.string.errorsize)+" "+(PreferencesActivity.SIZELIMIT)/(1024*1024)+"MB",Toast.LENGTH_SHORT).show();
-			return false;
-		}
-		
-		
-		
-	}
-
-
-	private boolean checkDimensions(Bitmap chosenImage) {
-
-		int width = chosenImage.getWidth();
-		int height = chosenImage.getHeight();
-
-		if (width <= PreferencesActivity.MAXWIDTH && height <= PreferencesActivity.MAXHEIGHT) {
-			return true;
-			
-		} else {
-
-			Toast.makeText(	this,this.getString(R.string.errordimension) +" "+ PreferencesActivity.MAXWIDTH
-							+ "x" + PreferencesActivity.MAXHEIGHT,Toast.LENGTH_SHORT).show();
-			return false;
-		}		
-	}
-
-
-	
-
 }
