本文介绍了无法解析second_activity Android Studio的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Android Studio的新手,我正致力于从一项活动转移到另一项活动.其他活动的名称是 activity_second .

I am new to Android Studio and I was working on moving from one activity to other. Name of other activity is activity_second.

以下是 SecondActivity Java类的代码.

The following is the code of the SecondActivity Java class.

public class SecondActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_second);
        if(getIntent().hasExtra("com.example.quicklauncher.TextView")){
            TextView tv=(TextView)findViewById(R.id.textView);
            String text=getIntent().getExtras().getString("com.example.quicklauncher.TextView");
            tv.setText(text);
        }
    }
}

这是文件夹结构的图像:

Here is an image of the folder structure:

推荐答案

尝试文件->使缓存无效/重新启动

Try File-> Invalidate caches/restart

这篇关于无法解析second_activity Android Studio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-01 23:38