M
M
m0t0d0r2022-03-07 17:39:45
Java
m0t0d0r, 2022-03-07 17:39:45

Android studio, java import inside "libraries" module?

package com.example.MyTestLib;

public class MyTestLibClass {
    public int GetWindowSizePx(){
        DisplayMetrics metrics = new DisplayMetrics();
        getWindowManager().getDefaultDisplay().getMetrics(metrics);
        return 123456789;
    }
}


This is the code inside the java DLL, the difficulty is that when I try to import DisplayMetrics , I can't, help me, as in the library code, insert the lines

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.os.Bundle;
import android.view.MotionEvent;

Like these.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Roo, 2022-03-08
@xez

Insert imports between package com.example.MyTestLib;
AND
public class MyTestLibClass

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question