Error:(23, 28) error: cannot find symbol class createFragment
here is the code:
public abstract class SingleFragmentActivity extends AppCompatActivity {
protected abstract Fragment createFragment(); @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_fragment);
FragmentManager fm = getSupportFragmentManager();
Fragment fragment = fm.findFragmentById(R.id.fragment_container);
if (fragment == null) {
fragment = new createFragment();
fm.beginTransaction()
.add(R.id.fragment_container, fragment)
.commit();
}
}
Drop the new from new createFragment() in line 23.
createFragment() is a factory method that produces a Fragment, and it should be called like any other method.
Using new createFragment() tells the compiler that there is a class named createFragment, and you wish to instantiate it with the default constructor. Since this class does not exist, the compiler throws an error.
Jason,Can you tell me what this error means?
----------------------------------------------------------------------------------------------------Error:Execution failed for task ‘:app:processDebugManifest’.
Manifest merger failed : Attribute meta-data#android.support.VERSION@value value=(25.3.1) from [com.android.support:appcompat-v7:25.3.1] AndroidManifest.xml:27:9-31
is also present at [com.android.support:recyclerview-v7:26.0.0-alpha1] AndroidManifest.xml:24:9-38 value=(26.0.0-alpha1).
Suggestion: add ‘tools:replace=“android:value”’ to element at AndroidManifest.xml:25:5-27:34 to override.
how can I get android studio to find my SQLite library?
thanks================================================================
java.lang.ClassNotFoundException: org.sqlite.JDBC