Skip to content
Snippets Groups Projects
Commit 0fa19897 authored by Harrion VENIER's avatar Harrion VENIER
Browse files

modification thread add sendActivity

parent 0482272f
Branches
No related merge requests found
......@@ -15,6 +15,7 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Qrcode">
<activity android:name=".SendActivity"></activity>
<activity android:name=".MenuScanActivity" />
<activity android:name=".ScanActivity" />
<activity android:name=".LauncherActivity">
......
......@@ -5,7 +5,6 @@ import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
......@@ -82,7 +81,7 @@ public class GenerateActivity extends AppCompatActivity {
request = new Intent(GenerateActivity.this, SendActivity.class);
startActivityForResult(request,15);
startActivityForResult(request,14);
}
});
......
package com.example.qrcode;
import androidx.appcompat.app.AppCompatActivity;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.content.Intent;
......@@ -13,9 +15,6 @@ import android.widget.Button;
import android.widget.ListView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import com.example.qrcode.thread.ClientClass;
import java.util.Set;
......@@ -66,8 +65,8 @@ public class SendActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_scan);
setContentView(R.layout.activity_send);
Toast.makeText(getApplicationContext(), "OK", Toast.LENGTH_SHORT).show();
listView=(ListView) findViewById(R.id.listView);
bluetoohButton = (Button) findViewById(R.id.bluetoothButton);
appButton = (Button) findViewById(R.id.appButton);
......@@ -127,7 +126,4 @@ public class SendActivity extends AppCompatActivity {
});
}
}
}
\ No newline at end of file
......@@ -4,8 +4,6 @@ import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothSocket;
import android.os.Handler;
import android.os.Message;
import android.widget.TextView;
import android.widget.Toast;
import com.example.qrcode.SendActivity;
......@@ -38,7 +36,7 @@ public class ClientClass extends Thread
try {
socket.connect();
Message message=Message.obtain();
message.what=SendActivity.STATE_CONNECTED;
message.what= SendActivity.STATE_CONNECTED;
_handler.sendMessage(message);
sendReceive=new SendReceive(socket, _handler);
......
......@@ -2,7 +2,6 @@ package com.example.qrcode.thread;
import android.bluetooth.BluetoothSocket;
import android.os.Handler;
import android.os.Message;
import android.widget.TextView;
import com.example.qrcode.SendActivity;
......
......@@ -3,7 +3,8 @@
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">
android:layout_height="match_parent"
tools:context=".SendActivity">
<Button
android:id="@+id/bluetoothButton"
......
......@@ -41,6 +41,26 @@
android:label="@string/second_fragment_label"
tools:layout="@layout/fragment_second">
<action
android:id="@+id/action_SecondFragment_to_FirstFragment"
app:destination="@id/FirstFragment" />
</fragment>
<fragment
android:id="@+id/FirstFragment"
android:name="com.example.qrcode.FirstFragment"
android:label="@string/first_fragment_label"
tools:layout="@layout/fragment_first">
<action
android:id="@+id/action_FirstFragment_to_SecondFragment"
app:destination="@id/SecondFragment" />
</fragment>
<fragment
android:id="@+id/SecondFragment"
android:name="com.example.qrcode.SecondFragment"
android:label="@string/second_fragment_label"
tools:layout="@layout/fragment_second">
<action
android:id="@+id/action_SecondFragment_to_FirstFragment"
app:destination="@id/FirstFragment" />
......
......@@ -11,4 +11,5 @@
<string name="hello_second_fragment">Hello second fragment. Arg: %1$s</string>
<string name="title_activity_generateqr">GenerateqrActivity</string>
<string name="bluetooth">Bluetooth</string>
<string name="title_activity_send">SendActivity</string>
</resources>
\ No newline at end of file
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