前の質問で入りきらなかったのでこちらに残りのファイルの貼り付けをしました。
前の質問も同じ題名で質問しております。
Kotlin6 activity _main.xml(自分でURLから改変)
<?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.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"> <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:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.example.pokotsun.opencvtestbykotlin.MainActivity"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="8dp" android:orientation="horizontal"> <Button android:id="@+id/select_img1_btn" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="画像1選択"/> <Button android:id="@+id/select_img2_btn" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="画像2選択"/> </LinearLayout> <!--画像のラッパー--> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <ImageView android:id="@+id/src_img1" android:layout_width="0dp" android:layout_height="100dp" android:layout_weight="1"/> <ImageView android:id="@+id/src_img2" android:layout_width="0dp" android:layout_height="100dp" android:layout_weight="1"/> </LinearLayout> <Button android:id="@+id/decition_btn" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:text="決定"/> <ImageView android:id="@+id/result_img" android:layout_width="wrap_content" android:layout_height="200dp" android:layout_gravity="center_horizontal"/> <TextView android:id="@+id/count_txt" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" /> </LinearLayout> </androidx.constraintlayout.widget.ConstraintLayout>
TestApp001 MainActivity.Java
package com.example.testapp001; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); }
TestApp001 activity_main.xml
<?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.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:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> </androidx.constraintlayout.widget.ConstraintLayout>
「分けた」と思っているのはご自身だけで、扱いとしては「別質問」です。1つに統一してください。
起きている問題を再現するために本当に全て必要なのかは一考してください。
問題が再現する最小構成のコードを改めて組んでみるか、それでも入らなければさいあくGitなど外部サービスの利用をご検討ください
自分で考えられる手段は考えたのとGitHubはまだ使いこなせないのでこちらに掲載してます。どこが問題なのか出来るだけ詳細に伝えるためにこのように掲載させて頂きました汗
こちらのソースで解決方法ベテランの方からみて考えられないでしょうか?
解決方法を切実に求めています、、
何と言いますか、他者サイト様の記事を基本、コピペし、自分で少し修正したものの、動かないのでそのまた第三者であるこのサイトで解決を求められると、問題を検討する気も失せると言いますか、ご自身で何とかしてくださいよ、と言いますか、、、
切実ならGithubくらい覚えましょう。急いだところで相手は赤の他人です。
単体で見たらこの投稿はコードだけ投稿されたなにも内容のない質問です。回答者の負荷が高すぎて相手されないと思います。
こちらの質問を削除依頼し、先の質問にコードをまとめてください。
(私は指摘することは一通りしたのでこれ以上は無視します)
回答頂いている方もいらっしゃるのと、自分でまだアプリを作ることが出来ないのでメソッドなど解析しながらとりあえずアプリを作ってみるということをさせて頂いております。あくまで参考しているというだけで...今はこの方法でしか行き詰まった時に突破する手段出来ていないので汗
GitHubも登録ずいぶん前からしてますが、中々ソースコード登録などのとっかかりが掴めていません。
私にとってエラー解決してくださる方が現れる貴重な場所ですので、出来ればしょうもないことを聞いてると思うのは分かりますが、エラー解決をコメントしてくれる方の妨害をしないで頂けないでしょうか。特に前回もm.ts10806さんのコメント頂いたのですが解決方法特に書いてくれるわけでもなく文句だけで特に困っています..
GitHubは登録出来そうだったらさせていただきます。自分なりにまとめたつもりなので、削除は出来そうだったらさせていただきたいなと。すみません。
あなたの回答
tips
プレビュー