删除的app的代码

 //create file
		/* FileOutputStream fout = null;
		try {
			fout = openFileOutput(fileName, MODE_APPEND);
		} catch (FileNotFoundException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}  
			String message2 ="*******a";
			byte[] bytes = message2.getBytes();  
	        try {
				fout.write(bytes);
			} catch (IOException e11) {
				// TODO Auto-generated catch block
				e11.printStackTrace();
			}  
	        try {
				fout.close();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} */
	        
	        
	        
		//show spinner
	/*	String[] sses;
		
		 String res1 = ""; 
		FileInputStream fin1 = null;
			try {
				fin1 = openFileInput(fileName);
			} catch (FileNotFoundException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}  
	            int length1 = 0;
				try {
					length1 = fin1.available();
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}  
	            byte[] buffer = new byte[length1];  
	            try {
					fin1.read(buffer);
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}  
	             res1 = EncodingUtils.getString(buffer, "UTF-8");  //get string   maybe utf -16
	            try {
					fin1.close();
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}  
	            sses = res1.split("a");
	            final ArrayAdapter<String> adapter = new ArrayAdapter<String>( this , android.R.layout. simple_spinner_item , sses );
	            mSpinner .setAdapter(adapter); 
	            
	            
	            */
	            

/*		  String res = ""; 
				  number = et.getText().toString(); 
				  number=(number+"a");
				  String fileName="a.txt";;
				FileInputStream fin = null;
				try {
					fin = openFileInput(fileName);
				} catch (FileNotFoundException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}  
		            int length = 0;
					try {
						length = fin.available();
					} catch (IOException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}  
		            byte[] buffer = new byte[length];  
		            try {
						fin.read(buffer);
					} catch (IOException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}  
		             res = EncodingUtils.getString(buffer, "UTF-8");  //get string   maybe utf -16
		            try {
						fin.close();
					} catch (IOException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}  
		            res=res.replace(number,"");//delete
		         //write back
		            FileOutputStream fout = null;
					try {
						fout = openFileOutput(fileName, MODE_PRIVATE);
					} catch (FileNotFoundException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}  
					
						byte[] bytes = res.getBytes();  
			            try {
							fout.write(bytes);
						} catch (IOException e) {
							// TODO Auto-generated catch block
							e.printStackTrace();
						}  
			            try {
							fout.close();
						} catch (IOException e) {
							// TODO Auto-generated catch block
							e.printStackTrace();
						} */


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值