package com.example.secondar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import com.google.ar.core.Anchor;
import com.google.ar.sceneform.AnchorNode;
import com.google.ar.sceneform.rendering.ModelRenderable;
import com.google.ar.sceneform.ux.ArFragment;
import com.google.ar.sceneform.ux.TransformableNode;
import java.util.ArrayList;
public class MainActivity extends AppCompatActivity {
private ArFragment arFragment;
private ArrayList<Integer> imagesPath = new ArrayList<Integer>();
private ArrayList<String> namesPath = new ArrayList<>();
private ArrayList<String> modelNames = new ArrayList<>();
AnchorNode anchorNode;
private Button btnRemove;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
arFragment = (ArFragment)getSupportFragmentManager().findFragmentById(R.id.fragment);
btnRemove = (Button)findViewById(R.id.remove);
getImages();
arFragment.setOnTapArPlaneListener((hitResult, plane, motionEvent) -> {
Anchor anchor = hitResult.createAnchor();
ModelRenderable.builder()
.setSource(this,Uri.parse(Common.model))
.build()
.thenAccept(modelRenderable -> addModelToScene(anchor,modelRenderable));
});
i tried every possible video on youtube aint working
it is not working the app keeps crashing every time I try running it it does not open at all
its the line setContentView that is the line logcat is directing me to when i click on the blue link in logcat and i have tried cleaning and bulding it again and also invalidating the cache but nothing seems to work