Question

Android Manifestxml | MainAcIM Java A L LIVILY_Malli. private static final int REQUEST ENABLE BT = 0; private static final in

how to solve this issue with line of code on android studio java bluetooth connection.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

You could try doing these steps :

1. You may have forgotten to import the main bundle :

import android.os.Bundle;

2. You may have defined this method in inner class of yours

Try moving the code of this method in outer class which is extending some kind of Activity class and import activity module using import android.app.Activity. Because onCreate() falls in life cycle state of Activity, so this method must be defined in class that extends Activity classes.

Example : public class MainActivity extends AppCompatActivity { } is a class extending Activity classes so can contain onCreate().

Add a comment
Know the answer?
Add Answer to:
how to solve this issue with line of code on android studio java bluetooth connection. Android...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • If anyone here is a Java and Android Studio expert please I really need help fulfilling...

    If anyone here is a Java and Android Studio expert please I really need help fulfilling the requirements needed to make a Rock Paper Scissors game. I mainly need Java code to complete it I will post what I have so far I don't have much time left please if anyone can help me I would really appreciate it. Here's what the app is supposed to do... The player should be able to select either Rock, Paper, or Scissors.The app...

  • Adroid Studio Error View.setOnClickListener Error: Class 'anonymous class derived from OnClickListener ' must either be declared...

    Adroid Studio Error View.setOnClickListener Error: Class 'anonymous class derived from OnClickListener ' must either be declared abstract or implement abstract method 'onClick(View)' in 'OnClickListener ' @Override Error: Method does not override method from its superclass package com.example.gregorybacon.assignment_1; import android.content. Intent; import android. support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view. View; import android.widget.Button; public class MainScreen extends AppCompatActivity f @0verride protected void onCreate(Bundle savedInstanceState) ( super.onCreate(savedInstanceState); setContentView(R. layout.activity main_screen); Button button_unlock-(Button) findViewById(R.id.button_unlock); button_unlock.setOnClickListener(new View.OnClickListener) L aoverride public void OnClick(View view) startActivity(new Intent( packageContext:...

  • Edit question this login java code allows to proceed to next activity even if no data...

    Edit question this login java code allows to proceed to next activity even if no data is enetered. add a constraint which displays a message to fill all fields. package com.example.Divahalls; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; public class LoginActivity extends AppCompatActivity { Button btnMoveToDashboard; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); btnMoveToDashboard=findViewById(R.id.buttonMoveToDashboard); btnMoveToDashboard.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent=new Intent(LoginActivity.this,CustomerActivity.class); startActivity(intent); } }); } }

  • Need help to build a fingerprint app that we have sslserversocket to tell a file use finger print...

    need help to build a fingerprint app that we have sslserversocket to tell a file use finger print before open the file what have been done below Here is my mainactivity.java and fingerprintHandler.java below <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> <TextView android:id="@+id/heading" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="8dp" android:layout_marginTop="8dp" android:layout_marginEnd="8dp" android:layout_marginBottom="8dp" android:padding="20dp" android:text="Fingerprint Authentication" android:textAlignment="center" android:textColor="@android:color/black" android:textSize="18sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" app:layout_constraintVertical_bias="0.0" /> <TextView android:id="@+id/paraMessage" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="8dp" android:layout_marginTop="8dp" android:layout_marginEnd="8dp" android:layout_marginBottom="8dp" android:text="Place your finger on the fingerprint scanner to...

  • I should show tables with info after clicking on the buttons in Android Studio. I still...

    I should show tables with info after clicking on the buttons in Android Studio. I still can not get what I should write inside OnClick function and how to use containers for printing tables. Please help me! import androidx.appcompat.app.AppCompatActivity; import android.content.Context; import android.os.Bundle; import android.text.Layout; import android.view.LayoutInflater; import android.view.View; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.LinearLayout; import android.widget.ListView; import android.widget.TextView; import java.util.ArrayList; public class MainActivity extends AppCompatActivity { LinearLayout container; ListView ListView1; ListView ListView2; ListView ListView3; @Override protected void onCreate(Bundle savedInstanceState)...

  • this java code allows to proceed to next activity even if no data is enetered. add...

    this java code allows to proceed to next activity even if no data is enetered. add a constraint which displays a message to fill all fields. import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; public class SignupActivity extends AppCompatActivity { EditText editTextName,editTextEmail,editTextPhone,editTextPswd,editTextCPswd,editTextAge,editTextFatherName; Button btnMoveToLogin; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_signup); editTextName=findViewById(R.id.editTextName); editTextFatherName=findViewById(R.id.editTextFatherName); editTextAge=findViewById(R.id.editTextAge); editTextPhone=findViewById(R.id.editTextPhoneNumber); editTextPswd=findViewById(R.id.editTextPswd); editTextCPswd=findViewById(R.id.editTextCPswd); editTextEmail=findViewById(R.id.editTextEmail); btnMoveToLogin=findViewById(R.id.buttonMoveToLogIn); btnMoveToLogin.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Log.i("Name",editTextEmail.getText().toString()); if(editTextEmail.getText().toString()=="" &&...

  • Need help to edit the code below. Am using it play a lottery game in Android...

    Need help to edit the code below. Am using it play a lottery game in Android Studio what i need help with is if play one game u need to clear it up before u could another game. Here is my activity_main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="simpleapps.my.lotteryapplication.MainActivity" android:orientation="vertical" android:layout_margin="10dp" android:weightSum="100"> <TextView android:layout_width="match_parent" android:layout_height="0dp" android:text="Enter White Balls : " android:textColor="#000000" android:textSize="22sp" android:layout_weight="15" /> <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:orientation="horizontal" android:weightSum="100" android:layout_margin="10dp" android:layout_weight="15"> <EditText android:id="@+id/wBall1" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="20" android:inputType="number"/>...

  • Need help to edit the code below. Am using it play a lottery game in Android...

    Need help to edit the code below. Am using it play a lottery game in Android Studio what i need help with is if play one game u need to clear it up before u could another game. Here is my activity_main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="simpleapps.my.lotteryapplication.MainActivity" android:orientation="vertical" android:layout_margin="10dp" android:weightSum="100"> <TextView android:layout_width="match_parent" android:layout_height="0dp" android:text="Enter White Balls : " android:textColor="#000000" android:textSize="22sp" android:layout_weight="15" /> <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:orientation="horizontal" android:weightSum="100" android:layout_margin="10dp" android:layout_weight="15"> <EditText android:id="@+id/wBall1" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="20" android:inputType="number"/>...

  • this customer java code allows to proceed to next activity even if no data is enetered....

    this customer java code allows to proceed to next activity even if no data is enetered. add a constraint which displays a message to fill all fields. import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.EditText; import android.widget.Spinner; import android.widget.SpinnerAdapter; import java.util.ArrayList; import java.util.List; public class CustomerActivity extends AppCompatActivity { EditText editTextName, editTextEmail,editTextPhone, editTextMenu; Button btnBook; Spinner s; String packageName; SpinnerAdapter spinnerAdapter; List<String> packages=new ArrayList<>(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_customer);...

  • In Android Studio, I just can't find the errors to this problem, I have the following...

    In Android Studio, I just can't find the errors to this problem, I have the following code written down, what I need is just how to make a direct route/directions between 2 specific coordinates, specifically I need the coordinates (34.782, -86.569) to have a direct route to (34.781, -86.571) thank you Here is Code: package com.example ------ import android.support.v4.app.FragmentActivity; import android.os.Bundle; import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.OnMapReadyCallback; import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.MarkerOptions; public class MapsActivity extends FragmentActivity implements OnMapReadyCallback...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT