Skip to content
Snippets Groups Projects
Commit 27bca9bd authored by skyfall174's avatar skyfall174
Browse files

Fixed OnFragmentInteractionListener error

parent 7976cf7b
Branches changing_drower
No related tags found
1 merge request!2Changing drower
No preview for this file type
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Kotlin2JvmCompilerArguments">
<option name="jvmTarget" value="1.8" />
</component>
</project>
\ No newline at end of file
......@@ -20,15 +20,15 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support:support-v4:27.1.0'
implementation 'com.android.support:design:27.1.0'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.android.support:gridlayout-v7:27.1.0'
implementation 'com.android.support:gridlayout-v7:27.1.1'
}
apply plugin: 'kotlin-android'
......
package cz.cvut.fel.www.tourify;
import android.annotation.SuppressLint;
import android.app.Fragment;
import android.app.FragmentTransaction;
import android.os.Bundle;
......@@ -93,7 +92,6 @@ public class Main extends AppCompatActivity
return super.onOptionsItemSelected(item);
}
@SuppressLint("InflateParams")
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
// Handle navigation view item clicks here.
......@@ -127,4 +125,6 @@ public class Main extends AppCompatActivity
return true;
}
}
......@@ -82,10 +82,11 @@ public class NotImplemented extends Fragment {
super.onAttach(context);
if (context instanceof OnFragmentInteractionListener) {
mListener = (OnFragmentInteractionListener) context;
} else {
throw new RuntimeException(context.toString()
+ " must implement OnFragmentInteractionListener");
}
// else {
//// throw new RuntimeException(context.toString()
//// + " must implement OnFragmentInteractionListener");
// }
}
@Override
......
......@@ -64,10 +64,11 @@ public class Places extends Fragment {
super.onAttach(context);
if (context instanceof OnFragmentInteractionListener) {
mListener = (OnFragmentInteractionListener) context;
} else {
throw new RuntimeException(context.toString()
+ " must implement OnFragmentInteractionListener");
}
// else {
//// throw new RuntimeException(context.toString()
//// + " must implement OnFragmentInteractionListener");
// }
}
@Override
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment