java - 字符串文字未正确执行

标签 java android eclipse sqlite

请帮忙,我该怎么办?我在“帮助程序执行中”出错,它说“字符串文字没有用双引号正确关闭。”

public class SMS extends Activity {
//
   public static final String DEBUG_TAG = "FullDatabase Log"; 
   public static final int DB_version = 2; 
   //public static final String DB_name = "User.db"; 
   public static final String TABLE_NAME = "login"; 
   //public static final String TABLE_NAME = "tbl_temp"; 
   //public static final String DB_name = "User_temp"; 
   public static final String DBNAME = "login"; 
   public DatabaseHelper database_helper; 
   public SQLiteDatabase database; 
   public SQLiteDatabase database_rd; 
   /** Called when the activity is first created. */ 
   public void onCreate1(Bundle savedInstanceState) { 
   super.onCreate1(savedInstanceState); 
   setContentView(R.layout.main); 
   Toast.makeText(this,"Before Bundled", 
   Toast.LENGTH_SHORT).show(); 
   createDataBase(); 
   //LogIn login = new LogIn(); 
   Button submit = (Button)findViewById(R.id.widget71); 
   Toast.makeText(this,"after Bundled", 
   Toast.LENGTH_SHORT).show(); 
   submit.setOnClickListener(new View.OnClickListener() 
   { 
                   @Override 
                   public void onClick(View v) { 
                   // TODO Auto-generated method stub 
            SMS createaccount = new SMS(); 
            Toast.makeText(createaccount.getApplicationContext(), "In Helper executing 
            onCreate1()", Toast.LENGTH_SHORT).show(); 
                           String[] success = insertRecords(); 
                           if(success[0].equalsIgnoreCase("1")) 
                           { 
                             Intent mIntent = new Intent(LogIn.this,DisplayUser.class); 
                                   mIntent.putExtra("username",success[1]); 
                                   mIntent.putExtra("retype",success[2]); 
                                   mIntent.putExtra("password",success[3]);  
                                   startActivity(mIntent); 
                           } 
                   } 
           }); 
   //database.close(); 
} 

最佳答案

在 java 中,字符串不能跨越多行。改变

Toast.makeText(createaccount.getApplicationContext(), "In Helper executing 
            onCreate1()", Toast.LENGTH_SHORT).show(); 

Toast.makeText(createaccount.getApplicationContext(), "In Helper executing onCreate1()", Toast.LENGTH_SHORT).show(); 

关于java - 字符串文字未正确执行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4356353/

相关文章:

java - 如何从远程主机访问 Glassfish V3 管理控制台网站

android - 包含 recyclerview 和 viewpager 的 ScrollView 不滚动

android - Spring Basic OAuth抛出错误的请求异常

java - MySQL 数据库无法连接到 Android 应用程序

android - 如何使用我的笔记本电脑蓝牙将 Eclipse ADT 模拟器连接到 Android 设备?

android - "read-only file system"写入SD卡出错

java - ResultSet:减少表被读锁定的时间量

java - 除非调整 JFrame 大小,否则图像不会出现

java - 在Eclipse Luna中安装STS(Spring)时出错

android - android是否保存静态变量?